I see your faith in catholic doctrine is greater than what is clearly written in the Word.
14But when I saw that
they were not straightforward about the truth of the gospel,
I said to Cephas in the presence of all, If you, being a Jew, live like the Gentiles and not like the Jews, how is it that you compel the Gentiles to live like Jews? Galatians 2:14
Sure sounds like a grave error in doctrine.
Perhaps if catholics would read Galatians they'd understand what Paul was writing about.
When one's "conduct" is not in step with the Gospel, one sins. He didn't teach heresy. Popes, just like the rest of us, can sin and even sin greatly. They are still popes.