I understand that the Catholic Churches teaches the doctrine of Papal Infallibility. What is the biblical basis for this and how does that account for the Scripture that references Peter's error?
But when Cephas came to Antioch, I opposed him to his face, because he stood condemned. For before certain men came from James, he was eating with the Gentiles; but when they came he drew back and separated himself, fearing the circumcision party. And the rest of the Jews acted hypocritically along with him, so that even Barnabas was led astray by their hypocrisy. But when I saw that their conduct was not in step with the truth of the gospel, I said to Cephas before them all, "If you, though a Jew, live like a Gentile and not like a Jew, how can you force the Gentiles to live like Jews?" Galatians 2:11-14 ESV