Drearyweather, Jesus himself says in Mathew 7:21-23 that he would not make such statements.
That's a bit absurd. The rock mentioned in Matt 16:18 is Jesus and not Peter. Eph 2:20 says that Jesus was the cornerstone of the true Christian faith. Peter and other apostles did take the lead but formed a part of the foundation, not the cornerstone itself. No way does it contradict with Matt 7:21-23.
Matt 7:21-23 says that those who do the will of God will be acknowledged by Jesus. The will of God was explained by Jesus and the other apostles who came after him and wrote the other books of the Bible.
If a scripture somewhere looks out of context then that means that it is necessary to dig deeper to understand the events when they were told. Matt 7 was a part of the Sermon on the mount told to a group of thousands of believers and unbelievers, whereas Matt 16:11-28 was a part of a private conversation between Jesus and his apostles. Jesus was preparing his apostles for his upcoming death and thus the conversation dealt with uncomfortable subjects leading to Peters admonition to Jesus and Jesus' resulting rebuke.
In the Sermon on the mount, Jesus told that blessed are the peacemakers. (Matt 5:9) But later, while sending his disciples for preaching, Jesus told that he has come not to make peace but with a sword. (Matt 10:34). Two different occasions, with different people addressed and in different contexts. Not contradictory.
Discrediting a scripture as not spoken by Jesus because we cannot reconcile it with the context is like me telling that Einstein did not invent the theory of relativity because I can't understand it.