If a Pope who has become a heretic mends his ways before the declaratory sentence, he recovers ipso facto his pontifical authority without any new election of the Cardinals or other legal formality.
— Objection: «If, as we have said, the Pope by the very fact that he has become a heretic loses his pontifical dignity and remains outside the Church, then it is not possible for him to go back into office, at least not in the sense of becoming Pope again, because such a return would have the force of a new election, in which case a council would be attributing to itself a right that belongs to the Cardinals, namely the right of electing, and this —according to Rosellus— is not something that can be done legitimately.
Answer: In the present case, according to the interpretation of ecclesiastical law, the right of election returns to the Cardinals only after a declaratory sentence of the crime, because the penalties imposed by the law itself cannot be executed without such a sentence… And it has not been shown that such a declaration should be pronounced in virtue of any existing law. But rather the opposite is true when the Pope mends his ways, as we demonstrated before. Thus, no harm is done to the Cardinals, since they receive back in a revocable manner the right of choosing another Pontiff, on condition that the heretical Pope be unrepentant and unwilling to mends his ways. It should be of no wonder if a reintegration of this type takes place without any legal solemnity, because, if a person loses ecclesiastical dignity by committing a crime—and this happens by a simple internal effect of the law (nudo juris mysterio fit)— by the same token, once the crime goes away by reason of the amendment, the thing goes back to its original state— also by a simple internal effect of the law.
Cardinal John Jerome of Albano, Tractatus de Potestate Papae, 1543.
Note, a Pope who is a heretic, BEFORE any declaratory sentence, and therefore before any trial against him, were to REPENT of his heresy, RECOVERS his Pontifical authority! Which means he can formally lose it before a trial.
This is possible because this entire scenario here is making the distinction between divine law and canon law. According to Divine Law, the heretical Pope has lost his office, it is taken away by Christ. And in terms of canon law this takes place by a "simple internal effect of the law". This means that there is no declaration necessary for him to have truly, in the eyes of God, ceased to have Papal jurisdiction.
Nevertheless, there OUGHT to be, for the good of the Church, a canonical declaration AGAINST him, to legally and canonically sever him from the Material Office he holds.
BUT if he REPENTS BEFORE that declaration, then the Cardinals would not have to hold a second election.
This is the proper understanding of that which takes place according to divine law, and that which takes place according to canon law. They are different from one another.