So what you are saying is that a man could be very good his entire life, perform all the right acts, make all the right prayers, do everything his church demands of him, and in the last few seconds of his life commit a sin and die, and he will not go to heaven because he was not purified before he died?
Yes, this is the Church's teaching, although in all judgement we should also hope for mercy. We also should pray for good death.