Has anyone about to be executed ever killed a guard resisting it?

I’m talking about within seconds or minutes of execution?

I’m particularly curious about whether it has been established in law that such a person no longer has a right to self-defense. It would seem to be an obvious, and legitimate, defense – assuming that the execution didn’t continue and there was ever a trial.

In the movie Return of the Jedi, as Jabba is about to execute Luke Skywalker (and Han Solo and Chewbacca), Luke uses the force and kills Jabba’s entire entourage, while Leia, in a metal bikini strangles Jabba to death. Ha! Ha! Ha! Ha! Ha!

Can’t think of a non-fiction equivalent.