I believe and I am not sure that this a fairly common western military custom. If you fuck up big than the person who caught you gives you a gun with a bullet. I think several Wehrmachy officers did this, although I can't name names. I think the British had this custom as well, not just in India though.
Yeah- I just used the example I'd seen most often referenced.
I also remember reading a story in James Michener's
The Covenant. A Scottish cavalry officer was ordered to lead his troopers against an entrenched Boer position- he knew that it wouldn't do any good and it was just an order given for the sake of the senior officers being seen to do
something and he refused, saying that he wouldn't get his men killed for nothing. His superior officer snarled something along the lines of "Damn you, sir, you
will attack that position". He decided to take his commander's order at face value, saddled up and advanced on the Boer lines alone. The Boers, wondering what the hell this apparent madman was doing, knew that he posed no threat and none of them really had the stomach to shoot as he drew closer and increased pace from the canter to the gallop. One of the Boers who knew something about the British Army figured out what must have happened and knew that this officer probably faced shame and court martial if he returned alive decided to put him out of his misery and shot him. Stuff like this counts as seppuku by proxy, I suppose.
Now that's just a fictional source but Michener exhaustively researched his work and would mention any complete fabrications in notes at the beginning of his books so incidents loosely like this may actually have happened.