Well this gets to the whole Apostolic Succession thing, doesn’t it? You either accept the whole line of papal succession or you don’t. Why only go back to Pius XII? If you look back at the history of the popes, there are all sorts of reasons to invalidate some of them, and if you invalidate one, you pretty much invalidate all of them that come after.
For the first millennia of The Church, there was no fixed method for choosing popes. It was variously done by a pope naming his successor, a secular ruler naming the pope or a default to the Bishop of Rome. It wasn’t until 1059 that the current conclave system was put in place and it is arguable that does not follow the example of Christ choosing Peter as his successor.
So either you buy into the idea that God would not let the succession go wrong, not matter how it might seem to us humans or you have to accept that Peter may have been the only legitimate Pope. But either way, these Sedevacantists are wrong.