In the machzor there are many variations on a theme that G-d does not desire the death of the wicked, but really wants them to do teshuva and live. For example,
For your praise is just as your name. You are slow to anger and quick to be appeased. For you do not desire the death of the condemned, rather, that they turn from their path and live and you wait for them until the day of their death, and if they repent, you receive them immediately.
"You Who desires the life and not the death of him who deserves to die."
and there is a passuk from Yechezkel 18:23
Do I desire the death of the wicked? says the Lord God. Is it not rather in his repenting of his ways that he may live?
In what circumstances does this apply?
It looks like it doesn't apply to someone sentenced to capital punishment by the Beis Din (and so 'deserves to die' in that sense), since seemingly G-d does not desire that person to repent and live - rather, it is a mitzvah to execute him.
If so, does it apply to someone deserving misa b'dei shamayim?