It is not “Peter” that Yeshua was referring to. Yeshua was referring to Peter’s answer to his question. It was that answer, that belief that he is Christ, as “the rock” - the foundation, of His Church. I am sorry your Catholic teachers have misinterpreted scripture for you.
Catholic teaching takes Matthew 16:18 out of the context that begins in Matthew 16:12. Yeshua is asking the disciples about who people say Yeshua is. Peter gives the correct answer to the question, that Yehua is Christ. And it on that point, belief that He is the Christ - not Peter, that represents the foundation of His Church - a spiritual entity, not a human institution. Human institutions can only hope and believe they are proper witnesses to that belief, but only Christ owns any authority as to if anyone does or does not have Him in their heart.