I may be misremembering the story or context, since I can't find it with an internet search at the moment.
There was an ancient Chinese general, who lost a battle. The punishment for failure was death. The punishment for mutiny was also death. The general learned of this, and lead his soldiers in a revolt.
I recall a similar one where a work party for the Great Wall was delayed, and delay was punishable by death, so the leader of the work party led them on a successful revolt instead, and became emperor.
There was an ancient Chinese general, who lost a battle. The punishment for failure was death. The punishment for mutiny was also death. The general learned of this, and lead his soldiers in a revolt.