While we see the primacy of St. Peter in Scripture, we also see that the strength to be bestowed on him as a witness to the truth of Christ has not yet come upon him in the instance you mention. What was promised in the scene depicted in Matthew 16 is fulfilled in the scene depicted in John 21:15-19 where we see his threefold confession to the Lord. When he is showing his lack of understanding of Jesus’ pending death, he is displaying his own weak spirit; and when he denies knowing his Lord, we see fear overtaking his usual quick boldness. Neither incident overthrows his Office as Rock, since the fullness of that will not come upon him until later.
Remember, too, that the Lord prayed for St. Peter that “when you have turned again, strengthen your brethren,” (Luke 22:31-32). This is what St. Peter and his successors do: they “strengthen the brethren”, for those in union with Peter have the surety that what he authoritatively teaches is free from error regarding Faith and Morals no matter what the personal weakness or sinfulness of any individual who holds that Office.