Even to prevent them continuing to kill someone else's child later?

A death sentence would certainly prevent this person from killing another child.

(Whether a death sentence is good for society in general is a different question)

It would not be good for a deceased either, especially if they are wrongly convicted.

Indeed, but it would also be not good to be wrongly sentenced to life in prison.

Once inside, chances to get out with a retrial are pretty slim.

Fatal misstakes are bad in any situation.