That sure seems a very tough way to live out the Christian life to the praise and glory of God’s saving and transforming grace. If our goal as Christians is to glorify God and enjoy Him forever, then the uncertainty of not knowing that you will eternally be in the kingdom of God would work against you… at least from the glasses perspective that I am wearing. What happens if I live a life pleasing to God, and I slipped up for the last two months at the end of my life due to some circumstances in my life?
First, if you had lived your whole life for God, it is extremely unlikely that you would “slip up” in the last two months of your life - well-formed habits of Christian living survive even such things as mental illnesses and physical deterioration - I have heard of a case where someone who was babbling senselessly, when the priest came in and made the sign of the Cross, she responded appropriately, and coherently, and was able to make a good Confession and receive Holy Communion before she died.
I know a man - an extremely elderly priest - who has the mental illness that comes about from alcoholism - he has no idea where he is, most of the time, but he can say Mass perfectly, and even gives a pretty good homily. He has no idea what city he’s in, but while he is saying Mass, he is, or he appears to be, in his right mind. Of course as soon as the Mass is over and he has put his street clothes back on, he is once again completely befuddled. But he still has his faith in God.
Secondly, mortal sin requires three conditions: first, the action must be a grave sin. Two months before your death, it is extremely unlikely that you would have the necessary strength to commit a grave sin, even if you wanted to. Second, you must have the full knowledge that the action is a grave sin. And third, you must have the free choice to commit the sin. Two months before you die, you are most likely going to be in a nursing facility or a hospital. Your movements are not going to be free. You’ll probably be on a lot of pain medication, which means that your will - your decision-making - is not going to be completely under your control. Under these circumstances, it is almost impossible to commit any kind of a sin, let alone a mortal sin.
But let’s say you are a new convert, so you don’t have well-established Christian habits. Let’s say you do something stupid (a mortal sin) that causes you to be killed (for example, for some reason you decide to rob a bank, and you are killed by the bank’s security guard) - and the whole thing has come about because of a lapse in judgement that is normally uncharacteristic, for you.
God will take your state of mind into account, whether you were acting freely, or whether you were having a moment of temporary insanity - and whether you had in fact turned your back on God and His way of life, or whether, had you lived, you would have turned back to Him in sorrow and penance.