Petra, a miscarriage of justice can arise from a stupid jury, incompetent counsel, a biased judge, mistakes in the CPS, or incompetent or corrupt police. Or fresh evidence may come to light after conviction. If the convicted person has already been executed nothing can be done to put things right.
In the early Sixties Penguin published two books, Hanged In Error and Hanged By The Neck, at the time of the big debates on capital punishment here. The second set out the reasoned arguments of principle against capital punishment; the first gave examples of the wrong person being executed. I found Hanged In Error the more convincing of the two, although I was and am anti cp on all the other grounds as well.