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.
Lord Voldemort in Harry Potter intentionally created six horcruxes (and one more unintentionally, making seven in total), splitting his soul into several pieces and hiding them in various inanimate objects so that, if he ever actually gets killed, then his soul will survive and he'll have a chance of returning. However, the process of creating a horcrux (which involves copious murder) comes with a vicious catch: if the maker ever feels remorse for his actions, then the magic separating his soul fragments from the one contained in his own body will immediately be nullified, with the pain of reintegration being so excruciating that it's often enough to utterly destroy him, killing him for good. Funnily enough, though, the fact that splitting your soul tends to result in your rapid devolution into a demented, sociopathic monster serves as a rather effective safeguard against the above fate.
On the flip side, dying with your soul in pieces like that is revealed to be a Fate Worse than Death: Harry actually feels compelled to offer Voldemort one last chance to show remorse before the final battle. It might be more accurate to say that Voldemort's insurance ran out the moment he put Draco Malfoy up to assassinating Dumbledore: had he been able to keep track of the Elder Wand's actual succession, he would have truly been its master and the outcome of the final battle might have been tragically different.
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.
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.
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.
Zuko in Avatar The Last Airbender is a variation. He's not immune to karma, but one thing he can always count on is his tremendous firebending power — right up until his big Heel-Face Turn. Then it craps out on him, as it was fueled by the negative emotions he's chosen to reject. Zuko has to re-teach himself to firebend through peaceful means in order to overcome his problem.
Family Guy: Peter gets away with abuse, attempted murder, actual 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.