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.
No Pope can ever fall into heresy at all.
Never at any time. Never under any circumstances.
But as I said, it is not necessary to argue about each Pope and
each teaching of each Pope, as if our judgment could ever condemn
a Pope as a heretic.
Jesus taught that the Pope is the Rock on which the Church is founded.
Therefore, no Pope can fall into heresy AT ALL.
Antipopes are not included in this protection, since an antipope is not
a valid pope, but a false claimant to the papacy.
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.