OK ... God PLANNED for Peter to stand firm with Jesus and NEVER waiver. (Let's go with that as a premise).
Matthew 26:31-35 [NASB]
Then Jesus said to them, "You will all fall away because of Me this night, for it is written, 'I WILL STRIKE DOWN THE SHEPHERD, AND THE SHEEP OF THE FLOCK SHALL BE SCATTERED.' "But after I have been raised, I will go ahead of you to Galilee." But Peter said to Him, "Even though all may fall away because of You, I will never fall away." Jesus said to him, "Truly I say to you that this very night, before a rooster crows, you will deny Me three times." Peter said to Him, "Even if I have to die with You, I will not deny You." All the disciples said the same thing too.
Here we have what MAN (Peter) planned ... what Jesus KNEW (said) would happen ... what GOD planned (prophesy of the events according to Jesus) from at least as early as Zechariah 13:7.
So if our PREMISE [God PLANNED for Peter to stand firm with Jesus and NEVER waiver.] is correct, then Jesus misunderstood the Prophesy and God's plan failed.
If my original premise [God planned for Peter to deny him] is true, then Jesus correctly understood the prophesy and God's plan unfolded as God had predetermined it.
So which was God's will/plan? Peter standing firm, or Peter's denial?
[PS. Just because it was God's WILL/PLAN does not mean God CAUSED it ... that "secondary causes" and "permissive will" thing ... like when God allowed Satan to kill Job's family or God allowed Joseph's brothers to sell him to slavers or God "gave them up to uncleanness, in the lusts of their hearts, to dishonor their bodies among themselves," - Romans 1:24. It just means that it was part of God's bigger plan ... "you meant evil against me; but God meant it for good" - Genesis 50:20].