killing a would-be avenger
Historical or dramatic term for a situation where someone seeking revenge is instead killed by the intended target. Often used in samurai or period contexts.
The samurai who came seeking revenge was killed instead.
having the tables turned; being beaten at one's own game
Figurative extension: a challenger or attacker is defeated by the person they targeted, often in a contest, argument, or scheme. Common in modern usage.
He tried to out-argue his opponent, but the tables were turned on him.
The robber was overpowered by his intended victim and caught by the police.