This from the link:
“Byng’s execution was satirized by Voltaire in his novel Candide. In Portsmouth, Candide witnesses the execution of an officer by firing squad; and is told that ‘in this country, it is good to kill an admiral from time to time, in order to encourage the others” (Dans ce pays-ci, il est bon de tuer de temps en temps un amiral pour encourager les autres).’”
I think that’s the source of it.
(I can’t depend on my memory like I used to!)
Supposedly, a Frog general said that during WWI when some soldiers were shot. Perhaps he was deliberately quoting Voltaire, whom he would probably know well.