>How is a sinner supposed to get saved if a judge decides to end his life prematurely?
Because it doesn't work with the judge sentencing them like "I sentence you to death, but I'm not gonna tell you when lolol".
In Catholic countries or countries with strong Catholic presence, on the night before the execution of the condemned, a priest would go in and spend the whole night with the inmate, soliciting them for contrition, pardon and confession, then providing them with last rites, so that they could at least die in a state of grace. In this respect it's probably one of the greatest spiritual luxuries you can have because
1. You know exactly when you are to die
2. You have a priest with you to hear confession and to ask him to ask for forgiveness of your victims, and for his prayers for your soul
3. You get to offer up your death-agony and fulfil your temporal punishment for sin
4. You can die in a state of grace
Compare this with how many souls at that time on the outside would be dying in a real unprovided for death.