It is not particularly controversial amongst Catholic theologians to say that popes have been heretical. Indeed, Pope Adrian VI stated as follows.
“If by the Roman Church you mean its head or pontiff, it is beyond question that he can err even in matters touching the faith. He does this **when he teaches heresy **by his own judgement or decretal. In truth, many Roman pontiffs were heretics. The last of them was Pope John XXII.” (Quaest. in IV Sent.)
Venerable Pope Pius IX († 1878) recognised the danger that a future pope would be a heretic and “teach contrary to the Catholic Faith”, and he instructed, “do not follow him.”
“If a future pope teaches anything contrary to the Catholic Faith,
do not follow him.” (Letter to Bishop Brizen).
This also implies that the Pope thinks those under his care are actually intelligent enough to learn and identify the Catholic faith, apart from a POpes personal interpretation of what that faith means!! Shocking!.
Pope Adrian II († 872) admitted that papal heresy “renders lawful the resistance of subordinates to their superiors, and their rejection of the latter’s pernicious teachings.”
“We read that the Roman Pontiff has always possessed authority to pass judgment on the heads of all the Churches (i.e., the patriarchs and bishops), but nowhere do we read that he has been the subject of judgment by others. It is true that Honorius was posthumously anathematised by the Eastern churches, but it must be borne in mind that he had been accused of **heresy, the only offence **which renders lawful
the resistance of subordinates to their superiors, and their rejection of the latter’s pernicious teachings”.
If even a pope thinks thus about his predecessors, then why do we not suppose it to be the case: THat a pope can fall into heresy and be a real heretic and teach it as his own opinon, not as the faith of the church?
The theologian Sylvester Prieras, O.P. († 1523) discussed the resistance of a corrupt pope at some length. He asked, “What should be done in cases where the pope destroys the Church by his evil actions?” and “What should be done if the pope wishes unreasonably to abolish the laws of church or state?” His answer was as follows:
“He would certainly be in sin, and it would be unlawful to allow him to act in such a fashion, and likewise to obey him in matters which are evil; on the contrary, there is a duty to oppose him while administering a courteous rebuke.
“Thus, were he to wish to distribute the Church’s wealth, or Peter’s Patrimony among his own relatives; were he to wish to destroy the church or to commit an act of similar magnitude, there would be a duty to prevent him, and likewise an obligation to oppose him and resist him. The reason being that he does not possess power in order to destroy, and thus it follows that if he is so doing it is lawful to oppose him.”
“It is clear from the preceding that, if the pope by his commands, orders or by his actions is destroying the church, he may be resisted and the fulfilment of his commands prevented. The right of open resistance to prelates’ abuse of authority stems also from natural law.” (Dialogus de Potestate Papae)