You could go further than that. You could kill someone for hurting an animal. You could kill someone for threatening arson. You could kill an entire army in wartime for no reason beyond wearing the wrong colors. In all of those cases the killing is justified by more than just bloodlust. I am not a pacifist.
Executions are different. People are not afraid to admit that they support executions because they like knowing that hated people will suffer. That is not something I will consider acceptable under any circumstances. If there were any evidence that capital punishment served a purpose beyond feeling good I would change my tune. But there isn't, so I won't.
We should not torture them on purpose but besides that I do not particularly care if they suffer or not during execution.
Does this include or exclude killing in self defense? Would a good person allow themselves to be killed rather than harming the attacker? Imagine that the assailant would be rehabilitated after serving 10-15 years for your murder and live a productive life with family and kids, does that change the equation? Is absolutist pacifism the end goal or is there an arbitrary line you are willing to draw?