The Pope cannot fall into heresy. God absolutely prevents it.
It is not necessary to argue about each teaching of each Pope, and then to judge whether any teaching is heresy or any Pope is a heretic. The Pope is the Rock on which the Church is founded. If any Pope could fall into heresy, that would not be true.
How does God prevent each and every valid Pope from falling into heresy?
By prevenient grace and actual grace. It is analogous to the way that God
prevented the Virgin Mary from falling into sin. She had free will, but she
was entirely unable to sin, due to grace.