Obviously right from the start we eliminate those who are culpably ignorant of the necessity of the Catholic Church and Baptism for salvation - as non-members who are outside the Church who refuse to seek the truth or turn a blind eye to it cannot die within that Church.
Additionally we sort out those who are not good willed and all who do not have a supernatural Faith and perfect Charity, or, being guilty of mortal sin, do not die with perfect contrition.
Are some Muslims, Protestants, Eastern Orthodox, Buddhists, Hindus, etc. capable of dying with a supernatural Faith and perfect Charity as Muslims, Protestants, Eastern Orthodox, Buddhists, Hindus, etc.?
How much time an ink is wasted and spilled by the ignorant (I lump myself in this group) who would be better served by doing almost anything else. Let us spend this time converting others. Converts must be baptized sacramentally. Water Baptism is not optional for them. They do not convert planing to die in order to avoid the Sacrament. They are not told that they become members of the Church by simply desiring Baptism and they can feel free to avoid being sacramentally baptized if they prefer. They are made aware that the must be sacramentally baptized before they can become members of the Church and partake of the other Sacraments. Though those converts/catechumens who die having desired the Sacrament and having planed on receiving it at the appointed time are not damned simply because they happened to die before they could obtain what they had desired.
Can we simply accept the fact that anyone who dies in a state of sanctifying grace goes to Heaven having obtained that grace within the Church and humbly defer to God and let Him sort out the goats from the sheep?