Could an old person, in a state of grace, commit mortal sin on their deathbed?
A lot would depend on how devoted to the Faith they have been during the whole of their life, and whether their life has been a constant growth in holiness. (“Two steps forward, one step back” would better describe me.) It’s certainly possible to lose your soul in your last moments, and the prospect of this should compel us to pray daily for a holy death. My final prayer before I go to sleep is “that I may save my soul, and that I may not be lost on the last day”.
It’s not at all farfetched to think that the evil one will see this as the last chance he has to drag yet another soul into hell, and that he will assault even a very holy person with doubts and temptations against faith. This is why it is so, so important that a priest be summoned when death is imminent.
Though we have no choice over the matter, you most definitely do
not want to die in your sleep, with no opportunity for the last rites of the Church.
“That is SO the way to go”, while a popular idea these days, is a sentiment unworthy of anyone who cares about their salvation. Likewise, you should not wish to die suddenly and without suffering, as happens in so many fatal accidents. My father and I saw a coffin being carried out of a Catholic church one time, and I commented
“his sufferings are all over now, or they may be just beginning”.