Holly: Are you implying that I occasionally stray from the rulebook? Foaly: I'm implying that you don't own a copy of the rulebook, and if you do, you've certainly never opened it. Holly: ...Fair point.
Lieutenant (later Sergeant) Murphy plays this straight when she helps out her wizard PI friend Harry Dresden, but in other cases tries to stick to the law. It's only after she gets dragged into Harry's world more she begins to go full cowboy. Off-screen she has to make a To Be Lawful or Good choice between ignoring the supernatural craziness infesting Chicago and keeping her career, or fighting it full-on and getting drummed out of the force. She chooses the latter, but not without regret.
Harry is effectively one of these as Warden of the Council. He's well respected and moral, but tries to skirt around laws that are there for a reason. Add that to his increasing strange list of allies and allegiances, and his warden and council colleagues find him hard to trust and predict.
Deconstructed with Sam Vimes in Discworld. Vimes, despite being promoted time after time, is nonetheless an archetypal Cowboy Cop, rejecting the rules if they stop him from doing his job and hunting down criminals - or, as in Night Watch, rejecting the code that has lead to the Watch becoming useless and Ankh-Morpork a police state - and frequently running up against Da Chief in the form of Vetinari (although Vetinari is quite trope-savvy in this case, and appears to willingly take the position of Da Chief in order to nudge Vimes in the right direction). The deconstruction comes because Vimes hates it - he hates that the system does not work, that it forces him to be a Cowboy Cop to get things done and that it keeps trying to push him into chaos when all that is important to him is the law.
Occasionally he resorts to it and the trope is played straight. It is always in circumstances that clearly warrant extreme measures. His rationalization: "It's me doing it." Put it this way; Vimes is a Cowboy Cop who kept getting promoted. He's also very aware that the justification "It's all right to break the rules because it's me doing it" could very easily be the start of a very slippery slope.
A character that is a unmitigated Cowboy Cop, is the wali of Prince Cadram, 71-hour Ahmed. As he says to Vimes (paraphrased): "Your beat is a city you can walk across in half an hour. Mine is a million square miles of barren desert with no company but sword and camel." His rationality is that he must strike first, and swiftly, before the criminal has a chance to. He got his nickname from when he killed a man in the man's own tent after 71 hours, not the 72 mandated by Klatchian hospitality customs, because the man had poisoned a well, and he had testimony and a confession.
When Vimes continues his Cowboy Cop ways in Night Watch, it works so well that Da Chief tries to have him assassinated. Ouch. Da Chief wasn't Vetinari this time- Vimes went back in time many years due to a magical accident and ended up as the Sergeant that trained his younger self. A young Havelock Vetinari actually saved Vimes from assassination at one point. This kind of thing happens on the Discworld all the time; apparently there's nothing that can be done about it....
Sergeant Detritus could be considered a Cowboy Cop as well. In his case, the subversion is that he's a troll officer who usually works the troll beat, and it could be argued that in a culture who regard hitting each other with rocks as a form of conversation, nailing drug-dealers to the wall by their ears is simply maintaining community relations.
The Godfather: Albert Neri was more than a "loose cannon" as a cop. Frustrated at the inability to do anything about the parking violations around the UN building he bashed in the ambassadors' windshields until he was reassigned to Harlem, then he smashed the skull of an unconscious pimp that he had caught molesting a little girl, which got him sent to prison. Fortunately, his father in law knew the Corleones, and Michael was looking for a replacement for Luca Brasi.
In Ragnarok, the first of The Echo Case Files, Navarro, a local police officer, brings a SWAT team along on a Confederate Marshals operation without getting permission from his superior. Except, well, this is a subversion: he's only a maverick because he's acting like a proper police officer in a corrupt department.
Joe Pickett in the novels by C.W. Box is a game warden with a reputation as a cowboy cop (his position does give him law enforcement powers). Joe doesn't set out to deliberately break the rules, but operating on his own a long way from any back-up means he often has to employ his own initiative. His 'cowboy ways' - along with a personality clash with his supervisor - even gets him fired at one point.
In The First Rule Of Survival, veteran South African detective Vaugn de Vries is seen, by the new Black African leadership of the SAPS, as an anachronistic dinosaur whose attitudes and approach to policing are not only a product of The Apartheid Era, but completely out of synch with modern policing methods. Knowing his time in the South African Police Service is most likely coming to an end, he takes on a case involving child sex abuse and trafficing of abducted boys in a manner that seriously strains the rulebook, and involves a lot of cowboy coppery.
Attorney Arcinas of Smaller & Smaller Circles displays shades of thismost notably, he jumps the gun by arresting the wrong suspect, which gets him a severe reprimand from the NBI Director, who nearly threatens him with the NBI version of Turn in Your Badge (i.e. being fired or having his law practice revoked). He does try to get his kicks by suggesting a manhunt for the Serial Killer towards the end of the novel.
Sano Ichiro is a Samurai who upholds the code of Bushido. His honorable approach to his job as the Shogun's Most Honorable Investigator of Events, Situations, and People works for his early cases in the series. But as his rivals, especially Chamberlain Yanagisawa are willing to push the boundaries more and more, Sano must begin relying more on finding loopholes, secretly breaking social rules about autopsies, and taking harsher approaches to suspects to get information so he can solve his cases and keep his reputation intact enough to not result in his and his family's exile and/or death.