From The Daily Knight by David Martin
The saints and doctors of the Church teach that if a pope having sufficient knowledge and having made sufficient reflection denies an article of Faith and professes heresy, he falls to heresy and loses his papacy.
When it is taught that ‘a pope cannot profess heresy’ it simply means that this profession cannot be made and completed while he is pope, for upon attempting to profess heresy he loses his papacy and is reduced to a heretic, whereby the profession is made as a heretic and not as a pope.
Hence a pope as a private person can profess heresy but could never make this profession while occupying the papal office. Consider the words of St. Alphonsus Liguori (1696-1797), Doctor of the Church:
“If ever a pope, as a private person, should fall into heresy, he should at once fall from the Pontificate. If, however, God were to permit a pope to become a notorious and contumacious heretic, he would by such fact cease to be pope, and the apostolic chair would be vacant.”
St. Robert Bellarmine, Doctor of the Church, makes this very point.
“A Pope who is a manifest heretic automatically ceases to be a Pope and head, just as he ceases automatically to be a Christian and member of the Church. Wherefore, he can be judged and punished by the Church. This is the teaching of all the ancient Fathers who teach that manifest heretics immediately lose all jurisdiction.”
St. Francis de Sales echoes this point as well:
“Now when the Pope is explicitly a heretic, he falls ipso facto from his dignity and out of the Church…”
The 1913 Catholic Encyclopedia states:
“The Pope himself, if notoriously guilty of heresy, would cease to be pope because he would cease to be a member of the Church.”
St. Antoninus says that such a pope who is cut off from the Mystical Body cannot be the head of that Body.
“In the case in which the Pope would become a heretic, he would find himself, by that very fact alone and without any other sentence, separated from the Church. A head separated from a body cannot, as long as it remains separated, be head of the same body from which it was cut off.”
The lus Canonicum on the 1917 Code of Canon Law by Wernz-Vidal makes this same point:
“A pope who falls into public heresy would cease ipso facto to be a member of the Church; therefore, he would also cease to be head of the Church.” It adds, “A doubtful pope is not pope.”
Continue reading at the Daily Knight
And as the fathers of the First Vatican Council stated very clearly:
“It was answered that there has never been such a case; the Council of Bishops could depose him for heresy, for from the moment he becomes a heretic he is not the head or even a member of the Church. The Church would not be, for a moment, obliged to listen to him when he begins to teach a doctrine the Church knows to be a false doctrine, and he would cease to be Pope, being deposed by God Himself.”
https://youtu.be/IALhx4-wx1E