John of St. Thomas explains that the legitimacy of a Pope who has been elected by the proper authorities and accepted as Pope by the Church is similar to a defined dogma that cannot be denied without heresy.
“It is immediately of divine faith that this man in particular, lawfully elected and accepted by the Church, is the supreme pontiff and the successor of Peter, not only quoad se (in himself) but also quoad nos (in relation to us) —although it is made much more manifest quoad nos (to us) when de facto the pope defines something. In practice, no Catholic disagrees with our conclusion (…) To the objection that there must be someone to propose this truth to the Church as de fide, I respond that the election and the one elected are proposed by the Cardinals, not in their own person, but in the person of the Church and by her power—for she it is who committed to them the power of electing the Pope and of declaring him to have been elected. Wherefore they, in this respect and for this task, are the Church herself representatively. Thus the Cardinals, or whoever else are electors legitimately designated by the Church (that is, by the Pope), represent the Church in all that concerns the election of her head, the successor of Peter. Just as the Pope gathers the bishops together in a Council, and yet its confirmation and the ultimate sentence in matters of faith depend upon him, so the congregation of Cardinals elects the Pope, and declares that he has been elected, and yet it is the Church, whose ministers they are, that by its acceptance ultimately confirms as a truth of faith the fact that this man is truly the highest rule of faith and the supreme pontiff. Wherefore, if the Cardinals elect him in a questionable manner, the Church can correct their election, as the Council of Constance determined in its 41st session. Hence, the proposition [that the one elected is a true Pope] is rendered de fide (…) the unanimous election of the cardinals and their declaration [that he is Pope] is similar to a definition given by the bishops of a Council legitimately gathered. Moreover, the acceptance of the Church is, for us, like a confirmation of this declaration. (…) As soon as men see or hear that a Pope has been elected, and that the election is not contested, they are obliged to believe that that man is the Pope, and to accept him (…) Whoever would deny that a particular man is Pope after he has been peacefully and canonically accepted, would not only be a schismatic, but also a heretic; for, not only would he rend the unity of the Church… but he would also add to this a perverse doctrine, by denying that the man accepted by the Church is to be regarded as the Pope and the rule of faith. Pertinent here is the teaching of St. Jerome (Commentary on Titus, chapter 3) and of St. Thomas (IIa IIae Q. 39 A. 1 ad 3), that every schism concocts some heresy for itself, in order to justify its withdrawal from the Church. Thus, although schism is distinct from heresy, in most cases it is accompanied by the latter, and prepares the way for it. In the case at hand, whoever would deny the proposition just stated would not be a pure schismatic, but also a heretic, as Suarez also reckons.” (John of St. Thomas).