From Eroica with Love has Dorian, a rogue and a thief, but he always seems to come off worst when he keeps his word and/or his intentions are good. The Major assumes the worst at all times, and pulls his nastiest double crosses when Dorian genuinely keeps his word or takes action to help.
Pet Shop of Horrors has Leon Orcot, who was characterised by his muleheadedness and cynicism over the supernatural. Count D welcomes him at the pet shop nonetheless...until Leon actually proves himself in a confrontation with D's father and recognises the pet shop and the Count for what they truly are. That's when he gets abandoned.
A Certain Magical Index's Accelerator didn't quite go unpunished, but he might as well have. What happened? Beaten up and kicked out of a program he actually didn't want to participate in in the first place. What had he done? Killed ten thousand teenaged (kinda) girls and planned to kill another ten thousand after that. So that people would quit messing with him. Maybe. After this, he pulls a Heel-Face Turn... and takes a bullet in the forehead for it. Permanent brain damage that leaves him unable to speak properly, use higher brain functions or motor control without outside assistance.
In the Monogatari series, Daiki seems to get away with scamming kids with little more than Koyomi's stern warning for him to never return. When he does return, he is implied to have gained some remorse over his past actions (not that he's going to admit it), so he goes out of his way to save Koyomi from a Snake God-influenced Nadeko and convince her to move on from her obsession with him, even if he has little to gain, or without the direct involvement of Kanbaru, the only person in town he has ever shown kindness to. And all it got him was a potentially fatal wound from one of the boys he scammed in the past.
Puella Magi Madoka Magica The Movie: Rebellion: Kyubey has spent millennia scamming and ultimately destroying innocent Magical Girls from all over the universe and walked away every time smelling like a rose. Even Madoka's giant "Eff You" at the end of the original system didn't "punish" him, per se, even though he hadn't gotten precisely what he wanted. But in Rebellion, karma finally finds him; in trying to reinstate the Witch System, Kyubey pushes his luck too far. By the time the dust settles, not only are his plans annihilated, he's ended up making Homura even stronger than Madoka herself, and proceeds to get his entire race enslaved and himself horrifically Mind Raped for his troubles.
Archie Comics' Sonic the Hedgehog: Geoffrey St. John got away with committing treason, which included a long list of actions such as letting Dr. Robotnik usurp the kingdom, because he was pardoned by his then recently crowned master, Ixis Naugus. When Naugus' plan to use mind control on the Council of Acorn fails, and Geoffrey finally sees Naugus for what he is, he tries to appeal to Naugus to change his ways, and gets possessed by Naugus. Now that the book has gone through a Continuity Reboot, Geoffrey's ultimate fate is unclear, but he's no longer relevant to the book. Though it's very possible that he's been wiped from existence due to the lawsuit that resulted in said reboot.
The movie Flight is about an alcoholic, hedonistic pilot who happens to save most of the people on his plane when it suffers a mechanical failure. Said pilot manages to convince plenty of people to stand up for him and help cover up the consequences of his alcoholism... right up until he has to testify in front of the hearing for the commission, at which point his guilt overcomes him, he confesses to being drunk during the plane ride, and all the consequences of his actions come back to bite him.
Subverted: He considers his stint in prison to be the best thing that ever happened to him, since it gave him the chance to clean up and fix his life, including allowing him to reconnect with his estranged son.
In Shooter, the main antagonist even gives a speech about his Karma Houdini status, and how he'll get away with everything because the protagonist has no proof. Too bad he forgot the protagonist isn't above working outside the law.
Gwendolyn in the Malory Towers series by Enid Blyton spent the entirety of the series as the spoilt, lazy, unpopular Butt Monkey of her form. In the 5th book, however, Gwen meets the new girl Maureen, a similarly spoilt and unpopular schoolgirl. Gwen takes a disliking to her, recognizing her own personality flaws in Maureen, and so makes amends to behave better. Unfortunately for her, the rest of the form is now fed up of dealing with Gwen's antics and takes no notice of her Character Development.
The character development, however, goes to hell in the 6th book, and Gwen does eventually get her comeuppance. Her father falls very ill, and so she has to drop out of the prestigious Malory Towers to acquire an office job as she cares for her father.
Artemis Entreri. He initially seems like a KarmaHoudini, but karma catches up big-time in the sequel. He gets beaten up by his nemesis and shot with a sleeping dart, leaving him hanging by a tattered cloak from a rock spur. The person he treated so badly from the trilogy finds him and cuts the cloak. He survives, but winds up in a city full of people just like him and finds out how bad his lifestyle choice is, eventually triggering a Heel-Face Turn.
Live Action TV
Prohibition Agent Nelson van Alden of Boardwalk Empire does some pretty heinous things in his pursuit of Nucky Thompson, eventually being caught out for a past murder and going on the run. Once he flees Atlantic City and starts a new life in Chicago, living under an assumed name with his baby and the nanny he later married, everyone pretty much gives up hunting him and he settles into an honest civilian life, the hardships and humiliations of which he sees as his penance. What drags him back into the dark is that his wife, who he's given vague warnings about his shady past, murders an innocent visitor who she mistakes for one of the "bad men", and covering up the crime puts him in debt to the Chicago mob.
Miles Edgeworth, from Ace Attorney, is an off-screen case. Ruthless prosecutor for years, forger of evidence (case 1-5 notwithstanding) and groomer of witnesses (er, yeah, moving on...). Never got caught, and presumably sent at least one innocent person to their death. He cleans up his act, starts fighting fair and... gets accused of murder. Oops. Still, at least he got a happy ending, unlike most of the characters who make this list as a result of Cerebus Syndrome.
In Miles' case, the extra case to the original game reveals Miles never actually forged evidence. He did, however, have forged evidence given to him by Lana Skye (acting on orders from the Chief of Police. He doesn't talk much about it but there's a moment of horror when it comes out.
Byakuren Hijiri from Touhou is another example. She once hunted down youkai to give herself a purpose in life, to assure she wouldn't "disappear." She eventually realized this wasn't the way to go about things, and changed her ways, relocating youkai to places where they couldn't harm humans, trying to make peace between the two species from behind the scenes. This got found out, and the humans who trusted her to be an exterminator before called her a traitor, and sealed her down in the demon world, Makai.
Near the end of Wolfenstein: The New Order, Deathshead's warranty finally expires. After seventeen years in-universe and thirteen years in real life, B.J. finally gets to kill Deathshead, although he may or may not have sacrificed his life to do it and technically Deathshead commits suicide rather than B.J. actually finishing him off.
Textbook case: Fox Maharassa from Friendly Hostility. A flirt and a danger magnet with little empathy, Fox got away with quite a lot. But the "transgressions" that actually landed his relationship with Collin in serious trouble and, if you follow the sequel comic, ultimately led to their breakup, weren't really his fault. It involved Arath dripping poison in Collin's ear (incorrectly accusing Fox of cruelty and cheating when not only did Arath have no proof, he didn't know Fox to any extent at all), being stuck in a catch-22 with Collin (Collin flatly refusing to explain why Fox was in the doghouse and playing the "guess what you did wrong" game), and even having the goalposts moved on him when he took drastic measures to rescue their relationship. In short, Fox went from a lovable rogue to The Woobie.
Collin himself suffered the Always a Bigger Fish version of this trope when he encountered Lovable Rogue/Magnificent Bastard/Karma Houdini Leslie Rudd. Collin was always obnoxious, but in the one case he had every right to be annoyed - Rudd having sent Collin's boyfriend into serious danger - he got smacked down by the one character with no right to criticise. Oddly, while Fox suffered a backlash from the fandom (and perhaps, the creator) when his Karma Houdini Warranty expired, Rudd was universally adored...and as he adhered strictly to the terms of his warranty, got a happy ending.
While the Warranty certainly expired as a result of a Cerebus Syndrome, blaming the breakup on Arath is hardly fair. Collin ignored his gossip for years before finally agreeing with him, and when he did, it was because of an accumulated bitterness over Fox' past antics and the fact that he was failing at the guessing game, combined with breaking the isolation he'd had from the rest of the world.
Yorick from The Word Weary makes constant fun of his friend, John, who never retaliates or threatens to end the friendship over the constant berating... as long as he's sober.
Magick Chicks: When we're first introduced to Faith, we're told she's the student council president, multi talented, and a powerful esper. As such she's initially shallow, petty, and manipulative. About mid way through the comic, she makes the mistake of using her psychic ability to bloodlust Layla, then tries to take her on without her powers! Big mistake. After Tiffanysaves her by allowing Layla to feed on her, to calm her down, Faith not only has a change of heart, she falls in love with Tiffany; which marked the beginning of her turn around. From that point onward, it's gradually revealed that Faith is actually a pretty nice girl. Which is right around the time that all the bad karma, from before, decided to pay her a visit: in the form of an unexpected psychic attack.
Things start going downhill for Cerise once she actually starts caring for her girlfriend Callie.
Family Guy: Peter gets away with abuse, attempted murder, genuined murder, and once accidentally burned down a hospital, he gets away with those. In some episodes he's hit with Poor Communication Kills and ends up the "sympathetic" character, his interactions with Carter end with Carter screwing him over.
Ed, Edd n Eddy, after years and years of having the Eds punished all the damn time, finally gives everyone else their karmic retribution in The Movie. And thankfully, it actually brings a genuine Heel-Face Turn from the other cul-de-sac kids, who realized that Eddy's brother, to whom they looked up to, is far worsethan they imagined, (Not to mention likely the direct cause of Eddy's jerkassery in the first place) even conspiring with the Eds to give him a much-deserved comeuppance.
In his autobiography Kitchen Confidential, Anthony Bourdain's professional career only hits bottom after he gives up heroin. He gets a happy ending.