He's following the law if he pays the penalty.
Whether you're guilty of murder or not is of course established after the fact. And you can do nothing wrong in the act of killing someone and still get screwed by a jury. Just ask the political left what they think of Kyle Rittenhouse being innocent.
You can certainly follow the law and go to jail regardless.