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?