The “gospels” were written long after Jesus’ death. Jesus may have said, “Before the rooster crows, you will deny me.” Knowing Peter’s character, Jesus reasonably could have made this prediction. But because Peter did, in fact, deny Him three times, the gospel writers may have “remembered” it that way years later.
How many times did the rooster crow before Peter denied Him three times? Mark wrote that it was twice (Mark 14:72) and also wrote that Jesus predicted, “Before the rooster crows twice… etc.” (Mark 14:30). The other three writers have Jesus simply saying “Before the rooster crows…”
The same when the rooster actually crowed, according to their accounts. It was just once. Somebody had to have had it wrong!
It doesn’t matter who has the foreknowledge. If a future event is known before it happens, then that event MUST occur. If someone knows that you will eat porridge for breakfast tomorrow morning, then it will come to pass. When tomorrow morning comes, there is no way you can refrain from eating porridge. Therefore you have no free will.
If you COULD refrain from eating porridge tomorrow morning, then it was not true that someone knew that you would eat porridge tomorrow morning.