In his celebrated book, De Ecclesia Christi, the renowned anti-Modernist Cardinal, Louis Billot, S.J, explains that the adhesion of the Church to a Pope is an “infallible sign” of his legitimacy:
"Finally, whatever you still think about the possibility or impossibility of the aforementioned hypothesis [of a Pope falling into heresy], at least one point must be considered absolutely incontrovertible and placed firmly above any doubt whatever: the adhesion of the universal Church will be always, in itself, an infallible sign of the legitimacy of a determined Pontiff, and therefore also of the existence of all the conditions required for legitimacy itself. It is not necessary to look far for the proof of this, but we find it immediately in the promise and the infallible providence of Christ: ‘The gates of hell shall not prevail against it,’ and ‘Behold I shall be with you all days.’ (…) As will become even more clear by what we shall say later, God can permit that at times a vacancy in the Apostolic See be prolonged for a long time. He can also permit that doubt arise about the legitimacy of this or that election. He cannot however permit that the whole Church accept as Pontiff him who is not so truly and legitimately."
"Therefore, from the moment in which the Pope is accepted by the Church and united to her as the head to the body, it is no longer permitted to raise doubts about a possible vice of election or a possible lack of any condition whatsoever necessary for legitimacy. For the aforementioned adhesion of the Church heals in the root all fault in the election and proves infallibly the existence of all the required conditions."
Notice that the adhesion of the Church “heals in the roof all fault in the election.” St. Alphonsus Ligouri, Doctor of the Church, teaches the same:
"It is of no importance that in past centuries some Pontiff was illegitimately elected or took possession of the Pontificate by fraud; it is enough that he was accepted afterwards by the whole Church as Pope, since by such acceptance he would have become the true Pontiff."
Cardinal Billot explains that the infallible providence of God will never permit the entire Church to adhere to a false head:
"[T]he infallible providence of God will prevent it from ever happening that the whole Church adhere to a false head; consequently, no one will ever be accepted as supreme pontiff who does not meet all the conditions necessary to be a member, whatever those conditions may be. That visibility, therefore, by which the true Church is recognizable as such, is in no way imperiled."