This is one of the most frustrating misunderstandings of a time full of frustrating misunderstandings.
Pastor Aeternus, Dogmatic Constitution of Vatican Council I
5. Therefore, if anyone says that it is not by the institution of Christ the lord himself (that is to say, by divine law) that blessed Peter should have perpetual successors in the primacy over the whole Church; or that the Roman Pontiff is not the successor of blessed Peter in this primacy: let him be anathema.
This is not a prophecy. Church councils do not deal in prophecy. It's an admonition.
You have to understand a little bit about the context of Vatican I. The 19th century may look stuffy and rigid to us today, from the perspective of our even more morally relaxed era, but in reality it was a
revolutionary century, marked in Europe by the fall of the French monarchy and the rise of Fɾҽҽmαsσɳɾყ. The tenor of the times was democratic and progressive. Kings were seen as a thing of the past, their days numbered.
As in politics, so in the Church, a clamor began to arise that the Church should adapt to the times, be more democratic, more progressive. The papacy began to be seen by some as outmoded, a relic of more autocratic and authoritarian times. The Pope, after all, is a kingly figure -- a spiritual king. He is not a president or primus inter pares. He is a stand-in for Christ Himself, the King of Kings... This is the background of Vatican Council I which was convoked to shore up the authority of the Pope once and for all.
That is why papal infallibility was decreed in the first place -- it was a defense mechanism, a counter-revolutionary move. With the Church losing its secular power by the day, its only recourse was to announce its spiritual power, which no government can take away. Remember that at this time the Papal States, which is the kingdom of the papacy, was reduced to the Vatican itself. Pius IX was a prisoner in the Vatican, and so were all the Popes until Pius XI, who began that routine of speaking to crowds in St. Peter's. ( I wonder if people realize today that Popes did not always travel around the world shaking hands and posing like they were part of some circus, but that this began with Pius XII. )
You have to read
Pastor Aeternus with all this in mind, and in context. There is no excuse not to, because this context is carefully given in the introduction of PA itself.
"6. And since the gates of hell trying, if they can, to overthrow the Church, make their assault with a hatred that increases day by day against its divinely laid foundation, we judge it necessary, with the approbation of the Sacred Council, and for the protection, defense and growth of the Catholic flock, to propound the doctrine concerning the 1. institution, 2. permanence and 3. nature of the sacred and apostolic primacy, upon which the strength and coherence of the whole Church depends.
7. This doctrine is to be believed and held by all the faithful in accordance with the ancient and unchanging faith of the whole Church.
8. Furthermore, we shall proscribe and condemn the contrary errors which are so harmful to the Lord's flock.
Translation: Lots of people are saying the Church should change and get with the times, they are going so far as to attack the institution of the papacy, and we are going to stop this right now.
Pastor Aeternus is all about reaffirming the power of the office of Pope. Now back to the original passage:
5. Therefore, if anyone says that it is not by the institution of Christ the lord himself (that is to say, by divine law) that blessed Peter should have perpetual successors in the primacy over the whole Church; or that the Roman Pontiff is not the successor of blessed Peter in this primacy: let him be anathema.
What this really means can now be easily seen in context.
Pastor Aeternus was directed against those who were democratic and progressive, like those who would later become known as Old Catholics, and who were starting to murmur against the papacy. Wouldn't it be better if the Church were democratic? Wouldn't it be better off being run by a college of bishops? Isn't the idea of a Pope with divine right something that should be left in the dustbin of history? These are some of the murmurs that were going around in that Americanist and revolutionary climate.
So
Pastor Aeternus is saying that if anyone thinks that the papacy
should be abolished, that there
should be any other means of government of the universal Church, that they are anathema. The papacy was instituted by Christ Himself and therefore should have perpetual successors -- I emphasize "should" because this does not mean "will." It is a mental attitude: Catholics must accept that the Church should always be led by a Pope, rather than by a president, or a parliament, or a college.
This has nothing to do with prophecy, it is not saying that a false Pope could never be elected. That is not something that is addressed in this docuмent at all. People just take it out of context and apply it to their own prejudices.