This was a necessary lesson to be learned by Peter. Left completely to ourselves, this is the inevitable outcome and Christ was completely clear in his teaching in Matt. 10:33 But whoever denies Me before men, I will also deny him before My Father who is in heaven. That’s why it’s clear that it’s only due to his sheer mercy, that the courage of Christ saves us from our cowardice. Christ has no need for Peter’s natural bravado, but rather Peter, like the rest of us, has a need to know how dependent we are on the strength of Christ.
Simultaneously, in this account, Jesus was willing to stand firmly on his confidence in God’s plan at the highest cost to himself. On the other hand, Peter was unwilling to stand on his association with Christ in order to protect himself at all costs.
The scene ended for Jesus with even his enemies unable to bring a charge of wickedness against him, whereas the scene ends for Peter with not only the guilt of denying Christ 3 times, but also disbelieving Christ’s words ahead of time that predicted it.
This is undoubtedly a low point for Peter, but one incredible feature about the NT as a whole, is the remarkable and comprehensive transformation of the fearful disciples into courageous apostles. Peter, the same one who capitulated and was cowardly, was later filled with the Holy Spirit and commissioned for apostolic ministry to be a key leader in the establishment of the church.