You are mistaken on this. Look at Scripture:
And I say also unto thee, That thou art Peter, and upon this rock I will build my church; and the gates of hell shall not prevail against it. Mat 6:18
Christ says that Christ will build His Church. He doesnt ask Peter to build a church. Christs Church is built on Peter.
Christ then tells us that His Church will always teach the Truth:
I have yet many things to say unto you, but ye cannot bear them now. Howbeit when he, the Spirit of truth, is come, he will guide you into all truth: for he shall not speak of himself; but whatsoever he shall hear, that shall he speak: and he will shew you things to come. John 16:12-13
Christ then tells us that His Church is the pillar and foundation of Truth:
But if I tarry long, that thou mayest know how thou oughtest to behave thyself in the house of God, which is the church of the living God, the pillar and foundation of the truth. 1Tim 3:15
Fortunately, we have Christs promise that heresies will never prevail against His Church. They will arise, endure sometimes for centuries, like Protestantism, but we can be confident in Christs promise that the Church He established will always teach the Truth.
Now a question for you: Where is it written in the Bible that you can only confess to a priest?
It isnt. But it is written in the Church Christ established.
The Catholic Church has created many rules and regulations over the years many of which have been changed and adjusted over the years. Look no further than Vatican II for example. Whether you agree with Vatican II or not, it doesn’t matter. Fact is policies and rules do change. The Roman Catholic Church was effectively started and institutionalized in Rome because it was the center of the known world and the seat of a great empire at that time, also because St. Peter and St. Paul eventually found their way to Rome. Many Catholic rules and policies have changed over the centuries. For example mandatory clerical celibacy was institutionalized until well into the Middle Ages and for reasons which have nothing to do with anything in the Bible. Was implemented largely as a response to corruption.