Also check out 2 Maccabees 12:46 and 1 Samuel 16:7
May the souls of all the faithful departed rest in peace. There is no salvation outside of the Catholic Church. But God alone knows the state of a soul at death. Thus, in our charity and love for all men – since we desire all to be saved – we continue to pour forth private prayers for the conversion and salvation and mitigation of Purgatory for everyone
Yes, the infamous assertion of the Dogma followed by a "but" or "however". The numerous times Councils and Popes have taught the dogma they never followed with a "but"...that is because the dogma was always taught without exception, and we are bound to accept the dogma as it is written.
even those who in our eyes died outside the Church
That is why they are presumed to be lost. If, simply for the sake of the argument, they is some chance they are saved and in purgatory..the lack of prayers said for them could very well be a part of their punishment for not having actually become members of the Church in their earthly life. Regardless, we have no business theorizing that they may be saved. That only serves to undermine the Dogma.
but who may have made a perfect Act of Contrition or who became Catholic by divine intervention right before the moment of death
Why do you beg the question that God would allow anyone He wishes to gift salvation to to die without affording him the means to actually enter the Church? No council or Pope ever taught this to the faithful. We are taught that the only those who have received Baptism and profess the true Faith are members of the Church, outside of which there is no salvation. What you are doing is reducing the Dogma to a meaningless formula..which is what Pope Pius IX, I believe, greatly lamented
The results of this theory are already clear: The vast majority of those who profess to be Catholic do not actually believe the most important Dogma: that there is no salvation outside of the Church