Here is St. Robert on the denial of St. Peter on the morning of Good Friday, "When St. Peter denied Christ, he had not yet begun to be the Supreme Pontiff, for it is certain that Ecclesiastical rule was handed to him by Christ in the last chapter of John, since the Lord said to him after the resurrection: “Simon, son of John, feed my sheep.” Therefore, that denial of Peter cannot be numbered among errors of the Roman Pontiffs. Besides, I add that Peter denied Christ with words, but not truly in his heart: hence Peter did not throw off the confession of faith, nor faith itself, as we showed previously." St. Robert Bellarmine, On the Roman Pontiff, vol. 2, trans. by Ryan Grant [Mediatrix Press, 2016], Book IV, Ch. 8, p. 175) - so see how differently God judges the heart from how man judges the exterior.
I'm sure some sedevacantist wise guy is going to tell me that, in that case, St. Peter was a "pre-election heretic"

The Doctors disagree is all I can say.
Jesus Himself has said, "Consider Peter. He denied Me. Why? Not even he knew why. Was Peter a coward? No. My Peter was not cowardly. Facing the cohort and the guards of the Temple he had dared to wound Malcus to defend Me, risking his own life thereby. He then ran away, without the will to do so. Then he denied Me, without the will to do it. Later he did remain and proceed on the bloody way of the Cross, on My Way, until he reached death on a cross. And then he bore witness to Me very efficiently, to the point of being killed because of his fearless faith. I defend My Peter. His bewilderment was the last one of his human nature. But his spiritual will was not present at that moment. Dulled by the weight of his humanity, it was asleep. When it awoke, it did not want to remain in sin, but it wanted to be perfect. I forgave him at once." The Popes may have made mistakes, but God forgave them, and took them to Heaven.
God has judged Pope Paul VI and Pope John Paul II, whatever mistakes they made, to be Saints in Heaven. How will you explain that, Pax Vobis? To me, it is difficult to explain, and the only thing that can come close to the correct answer is what Our Lady is reported to have said at Bayside, that Pope Paul VI is a blessed man and will be martyred, because there was some impostor, and these things were happening against his will. "Your Father, in the eternal city of Rome, Pope Paul VI, your Holy Father, is a blessed man, for he carries his cross. Your Holy Father is a blessed man, for he shall be martyred." - Our Lady at Bayside, June 18, 1977. That came true 41 years later.
I don't know the full explanation. Much of it is still a mystery. But both R&R and SVism fall short of the real explanation, for they are inconsistent. Svism is inconsistent with doctrine, and R&R is inconsistent with itself, in claiming to recognize the Pope while also wanting to be out of communion with him, and not recognizing and venerating the Popes and Saints declared as such ex cathedra by the Pope.