Searched for similar discussions and found the following:
Bellarmine and Suarez considered a de facto possibility of an heretical pope. They granted that the Church would have to depose him if he did not self-declare his heresy. They differed on the exact procedure that would be required. Basically, electors would de-designate the man chosen pope. But as such, they had no authority over the papal power itself, which is from God.
In recent discussions of an heretical pope, the term sedevacante shows up. It means that, if a pope is heretical, his chair is automatically vacant by divine law. Some hold that anyone can so pronounce this vacancy, which would logically make every man his own pope. Bellarmine and Suarez thought the Church, in the persons of a General Council or the assembled Cardinals would have to declare the pope a heretic and depose him. They differed a bit on the exact procedure.
Several writers imply that suddenly the institution, which seemed so solid over the centuries, appears shaky in its own order. “If the Church succuмbs to modernity, will it still be a Church?” they wonder. The main issues, in the case of Francis, revolve around the indissolubility of marriage, the nature of the papacy itself, and the approval of gαy life as normal. The first is a question of reason and revelation – Moses allowed divorce, Christ did not; the second of revelation; and the third, ɧoɱosɛҳųαƖity, of reason.
Heretical popes? The essence of Catholicism is that there be none. It is also its essence that, if necessary, the issue be faced squarely and judged fairly.