Maremia
Yes, Franbern has posed a philosophical question.
I don’t think she has.
I think she has interpreted prayer in a simplistic, childish way as in “ Please God, make the Pope better”, like we might have done 70+ years ago for our pet hamster.
To pray for healing whether physical or spiritual is not the same as “ Don’t let him die”. It’s also a prayer for his ministry on Earth- much needed in these troubled times- and it’s a prayer for the Church and for all of humanity.
Sometimes we pray for suffering to be eased or for a peaceful passing, a “holy and happy death”. But there is no hidden motive of delaying going to heaven as OP implies.
Death can come at any time in our lives, sometimes after a full one devoted to others, but sadly too early for many more whose lives are cut short by illness, accident or war. Of course we do not want to be parted from those we value or love, but that is not a wish to “keep them from heaven”.
So I find the question posed by OP to be based on a fundamental misunderstanding of “prayers for Pope Leo”.