Where did this trope originate: sheriff turns in badge so as not to enforce an order

I remember seeing in several works a situation where a lawman in a Wild West setting is tasked with enforcing the law in a situation where he thinks it’s unjust; he refuses to do so and dramatically removes badge. There may have been more examples but I remember three: 1) in the 1980s after-school space Western cartoon “Bravestarr”, there are episodes where the main character does this (in “Bravestarr and the Law”, Marshal Bravestarr quits when ordered to evict his foster father the Shaman from the cliff where he lives based on a villain’s false land claim; in “Revolt of the Prairie People”, his deputy, Fuzz, a member of a race called the “Prairie People”, refuses to be deputy while a policy to close off his people from the rest of the planet New Texas in a force field-protected reservation is enforced, and joins the revolt); and in the “Dr. Quinn, Medicine Woman” episode “Reason to Believe” (Dr. Quinn’s husband Sully is lost and believed dead; Matthew, the sheriff, is helping her look for him. An Army sergeant comes up to him and tells him that Sully has been accused of murder and treason, and indicates that he has been given authority to command him to pursue Sully and do his duty as Sheriff. Matthew pulls off his badge, says “Not anymore”, throws the badge to the ground, and sets off on another search for Sully with Dr. Quinn.)

I was wondering if the situation I have described is an established trope. Is there some old Western movie or novel where there’s an “ur-example” of this kind of scene taking place?

I always associated with buddy cop movies of the 1980s. The hard ass chief takes away our heros badge and gun as he stepped over the line one too many times chasing Big Bad Guy. But that’s not going to stop him, or his straight laced, partner bringing him in!

Yeah, I know the situation. This is a well-known trope - where a cop gets fired for his rogue methods: Turn In Your Badge. I’m thinking of a kind of inversion, where a cop quits in order to be able to do justice over enforcing an unjust order. I wonder if there are enough recognizable examples of this to create a trope.

Contrary to popular myth, the defining characteristic of a lawman is not his gun; it’s his badge. (In the opening of Dragnet, Sgt. Joe Friday says, “. . . I carry a badge.”)

Thus, a sheriff turning in his badge is a good way to show that he’s resigning his position.

The relevant tvtropes page is “Resign in Protest.” If you have some free time, you could browse down searching for the earliest examples. (There’s a nifty instance from real-life history in 1939.)

Although that does seem a better fit, the page for Bravestarr lists those examples under Ten Minute Retirement. Neither one really emphasizes the “turn in your badge” aspect, though.

If it’s a trope, then it’s a misapplied trope. Numerous law enforcement agencies refuse to enforce numerous laws. In many cases they are ordered to by the executive branches of their particular governments (state, local, federal or otherwise).

Moved to Cafe Society (from GQ).

IMHO, the granddaddy of all badge drops was Gary Cooper in High Noon, where he quits right after he and his wife finish offing the bad guys after no one else in town would help.

Not precisely what the OP asked for, so feel free to keep searching for the OG won’t-obey-an-order-I-disagree-with-this-strongly example. I just wanted to bring up the granddaddy.

First thing to leap to my mind is Patrick McGoohan resigning in the opening to “The Prisoner”

Mama, come take this badge offa me…

“Resign in Protest” could cover it, although it’s by no means limited to lawmen turning in their badge and the element of resigning to avoid obeying an order isn’t necessarily there. BTW, I’m the one who edited the TV Tropes page on Bravestarr to include the episode “Bravestarr and the Law” under “Ten Minute Retirement”. That isn’t the same trope, but also applies to that episode as by its end, the conflict is resolved and Bravestarr has been reinstated as Planetary Marshal.

This seems like a good example. Haven’t seen the movie (or don’t remember seeing it), but I had a look at the synopsis on Wikipedia. Two examples of “Resign in Protest” happen in the film - first his deputy quits when the marshal won’t name him as his successor, then the marshal, who was just retiring anyway, throws his badge on the ground in protest after getting no help with the bad guys. Perhaps the examples I gave were just examples where the motivation for quitting was a little different, but which may have been inspired by this one, or a string of examples going back to this one?