Like the Minion with an F in Evil, the Hero With an F in Good almost always is basically a nice person deep down, but while the Minion with an F in Evil became a Punch Clock Villain because Evil Is Cool, but his Pet the Dog personality foils his bosses' plans, this character sometimes daydreams of becoming one of The Hero's True Companions, or being the hero by himself, but serious character flaws make it a poor career goal. He doesn't have a problem with doing heroic things, but he does have trouble when it comes to other aspects of being good.
Noble Demon: while the Noble Demon cultivates his "bad" reputation, this character daydreams of being a hero. Can be the result of a Noble Demon doing a Heel Face Turn and realizing they don't know a thing about being a hero.
Isaac Dian and Miria Harvent work on atoning for their previous (harmless) crimes by stealing large amounts of cash and goods from wealthy families Just Like Robin Hood.
Half of this show's cast fits this, as even the protagonists are often The Mafia, a Noble Demon, a liquor bootlegger etc. Also note Durarara's entry as well. The author, Ryhogo Narita, is in love with this trope.
Durarara: Shizuo Heiwajima really does want to do good by people — it's just that his massive anger issues and Unstoppable Rage tend not to discriminate between bad guys and innocents. After all, how accurate can you be with a thrown vending machine?
Sousuke from Full Metal Panic. He's a good person at heart, but he's also a Child Soldier who was trained as an assassin by the KGB, brought up as a freedom fighter in "Khazakhstan," and was working as a freelance mercenary by the time he reached his teens. As such, he approaches every situation as a battlefield operation and is completely incapable of understanding civilian life, with the result that outside of actual combat situations he frequently does more harm than good with his disproportionate applications of violence.
This is probably the most even-handed way to describe Shinn Asuka from Mobile Suit Gundam SEED Destiny without descending into the Fan Dumb battles that have raged since the show ended. His main motivation is to protect the innocent, but he has severe anger issues and an anti-authority streak that gets worse over time because his commanders punish him for bad actions and seem to never notice the good he does. The moment that divides the fandom is the death of Stella Lousier, who was killed by Kira Yamato; this permanently ensures that he will never be a part of Kira's team, which means that as Kira gradually starts taking the forefront, Shinn gets portrayed as a mindless attack dog on a wire leash.
Making it really sad, the spoilered point above is simply a Gone Horribly Wrong version of something Kira himself did in the original Gundam SEED (returning Lacus Clyne to ZAFT). As for Shinn being manipulated, can he really be blamed for siding with the Chairman who treated him like a son rather than Athrun, who Bright Slapped him once for disobeying orders*
Breaking ranks during combat to free some refugees
and once for obeying them? Super Robot Wars (particularly Z and L) fixes this by having Kira help save Stella instead of killing her, defusing Shinn's anger and giving them the chance to become friends.
Itachi from Naruto might not be what he appeared to be at the outset, but there's still the fact calling him "one of the good guys" is quite a stretch. While Itachi killed the Uchiha family to prevent a devastating civil war (although wholesale genocide as a peacekeeping measure is rather fucked up, too) rather than simply as a way to test his own powers, he made some rather complicated decisions regarding sparing his little brother Sasuke; rather than simply kill him, Itachi decided to spare his life and try and make Sasuke hate him enough that he could commit Suicide by Cop later to turn Sasuke into a hero and let him live free of the shadow-conflict that consumed their family. Unfortunately, he did this by inflicting horrificMind Rape upon Sasuke on the night of the massacre and later on, emotionally crippling Sasuke for the rest of his life, and Itachi's eventual suicide at Sasuke's hands was implied to be just as much for Konoha's sake and his own self-loathing as it was out of any affection for Sasuke. Unsurprisingly, a lifetime conditioned into obsessive hatred for his brother to the exclusion of all else means Sasuke goes completely batshit insane once Itachi's gone and Madara gives him a slanted account of Itachi's life, but Itachi turns out to have had a plan for this; using Sasuke's erstwhile best friend Naruto as the delivery system, if Sasuke failed to become the hero Itachi wanted him to be, Itachi left behind a posthumous genjutsu that would brainwash Sasuke into protecting Konoha with his dead best friend's mind-controlling eye. While he is depicted as a man who made many sacrifices and tough choices, Itachi is still dangerously close to just being a Manipulative Bastard with an Omniscient Morality Licence.
When he was revived via Edo Tensei, he eventually acknowledged that he was wrong, and realized that the most he could do was hope Naruto would fix everything.
Tentai Senshi Sunred is a short-tempered, easily irritated bum with a pachinko addiction who survives day-to-day on the sufferance on his girlfriend Kayoko. His glory days of Sentai leadership long behind him, he now fights the monsters of Evil Organization Florsheim simply because they won't leave him alone, and even then tends to treat it as an annoyance he'd rather be without.
You're Under Arrest!: The Striker the self proclaimed hero only causes more damage than good on anything.
Hank Pym from The Avengers. He tries to be a hero but his unstable personality sometimes makes him more of a menace. He is another one who's getting over it, what with leading the last Mighty Avengers incarnations who, in-universe, nearly overshadowed Norman Osborn's Dark Avengers. However, his tendency to screw up things is still there too...
Case in point: Ultron. It's something he'll likely regret for the rest of his life.
Depending on the Writer, Deadpool can be this when he tries to be a good guy. He's too violent and psychotic to really pull off being a hero, too conflicted and silly to really be a villain, and tends to swing between Anti-Hero and Anti-Villain like a pendulum. Most of the heroes of the Marvel Universe can't stand working with him (Cable and Siryn being rare exceptions), and considering it's a Crapsack World where even guys like The Punisher and The Hulk are afforded some respect and trust, that's saying something.
F in Good or in evil, depending on your side: during the Civil War storyline, he became a registration enforcer… then he attacked superhero groups because he didn't check they had registered!
Max Damage from Incorruptible. He got scared straight when the resident Captain Ersatz of Superman snapped and went on a rampage. The book's about his struggle to redeem himself, but all he knows about being good is "do the opposite of what you used to do".
The Spectre, God's Angel of Vengeance, has such a horrifically skewed sense of proportion and priorities that, he needs to be kept bound to a morally upstanding human soul just to reach the level of Good Is Not NiceSociopathic Hero. That's right, not only did he get an F in good, but God gave him a cheat sheet, and he's still only getting Cs and Ds.
The Hal Jordan version of the Spectre is a lot less vengeful, but makes up for it by being incompetent. His more notable deeds include the time he resurrected Green Arrow as a soulless amnesiac, and the time he restored Wally West's secret identity by making everyone in the world forget who the Flash was. Including Wally.
Booster Gold before he grew out of it. Aside from being big on corporate sponsorship, Booster once opened a Justice League themed casino using the entirety of the League's funds without the League's consent to use the funds or their endorsement. His partner in this venture, Blue Beetle, would fall into this category too but he had a longer history of heroism and only got into this sort of trouble when Booster was around.
He also stole all the tech he uses to fight crime as well as the time machine he used to escape to the past.
Star Wars: Anakin Skywalker in the prequel trilogy. He's brave and willing to risk himself for others, wants to do what's right, joins the foremost good guy organization... But he's impatient, uncontrolled, unable to accept his place and constantly tempted to just go ahead and (to sum up all the various temptations) do whatever he damn well feels like at the moment. When he does, it ends badly for everyone. After that he becomes an entirely different character who gets an A in Evil easily. Until the end of Return of the Jedi, that is.
Chronicles of Thomas Covenant: Thomas Covenant becomes one of these in the first trilogy, after an act that many consider a rare "heroic" Moral Event Horizon. Covenant himself is sickened and guilty over what he's done and tries to make up for it where he can, but he generally just winds up making things worse. For example, he's trying to atone for his rape of the village girl Lena. He knows that Lena loves the Ranyhyn, so when he's able to command them at one point, he tells them to visit her annually. Problem is, they're still held by this command when the Big Bad is on the verge of destroying the world, and it keeps them from fleeing to safety. This nearly leads to the extinction of the Ranyhyn. It's worth noting that while Covenant does turn out to be a good person, (very) deep down, it takes three whole books for either him or the reader to admit it.
In a very real sense, the entire point of the first trilogy is the psychological redemption of an utterly broken man into someone who can live with himself - the first book setting him up as someone the audience very likely hates as a reflection of how badly he already hates himself. And since the series very strongly straddles the line between reality and psychological allegory (and occasionally argues that both answers are valid), by definition saving the Land saves his own soul - and vice-versa.
This entire framework continues into the second trilogy - except instead of being Covenant's redemption, it's the story of how Linden is ultimately tested and redeemed (and no, all the references in the series to alloys and forging aren't coincidental at all). It's hard to tell if the third (and final) tril... err, tetralogy follows the same pattern, and if so, precisely WHO is being redeemed. As of the third book, it's clearly not Joan, Jeremiah shouldn't need to be redeemed, and Roger shows absolutely no sign of showing an ounce of remorse or growth. If anything, the true harrowed character (if any) might be Lord Foul himself, "She Who Must Not Be Named", or the entire world of The Land as a whole.
Molly Carpenter , Nice girl, not very good with using moral methods to present moral outcomes. There's a reason there's a death sentence over her head if she gets out of line. It starts with using mind control to get a friend off Heroin, which ended up being more Mind Rape. Oh, and Black Magic is addictive too. She keeps trying to use Mind Rape several books later when she feels its worth it (it never is).
In the obscure children's book Simson and Samson, Sir Simson looks like and does his best to be a classic heroic knight. He's not very good at it, generally wreaking so much incidental havoc that the peasantry desperately hopes he won't try to help them with their problems.
This is why, in Twilight, Jacob is considered inferior to Edward. Jacob is ostensibly nicer, shares more of Bella's interests, lacks Edward's self-loathing issues, and seems like a lot more fun - but unlike Edward he isn't particularly ashamed of his monster side, and has extreme mood swings in which he could do Bella serious harm (wheras Edward has much better self-control). At one point, he even decides to take revenge for Bella dying in childbirth by murdering her baby, because it killed her.
Rachel's the most powerful example, but really, they all get this way after a while, particularly Marco and Jake. It's one of the running themes of the series — and the great thing about a series that's 52 books long is that it happens so slowly and gradually that there's never really a moral event horizon. It just happens. One of the themes is that War Is Hell and you become less... you... as time goes on, one I Did What I Had to Do moment at a time. Worse, (well, best in terms of writing, worst in terms of what it's like to live in that world) it's hard to say that any of the things they ended up doing were unnecessary.
Live Action TV
Buffy the Vampire Slayer: Spike from in season 5 frequently falls into this trope, often doing things not because it's right but because it's what Buffy would want.
Spike: I'm not sampling, I'll have you know. Just look at all these lovely blood-covered people. I could, but not a taste for Spike, not a lick. Knew you wouldn't like it.
Charmed: Cole Turner. While, admittedly, he is the victim of double standards, he does have trouble doing good, even during the times he isn't being treated unfairly. Often end up solving problems using violence.
Jowan of Dragon Age: Origins is blood mage who, unlike the others you meet, is perfectly well-meaning and just wants to live a normal life and do some good. Unfortunately, his efforts at doing so all end in disaster.
According to Word Of God, Jowan was supposed to be a recruitable party member with the ability to teach mages Blood Magic and a possible love interest for the female Player Character. Time constraints have forced the developers to cut him down to an NPC.
Yuffie from Final Fantasy VII tries to be good, but she just accidentally gets an entire trope name after her inability to do so.
Abraham from El Goonish Shive basically defines this trope. He's a Well-Intentioned Extremist trying to destroy the "abominations" created by the Dewitchery Diamond—the diamond that he enchanted. This is lampshaded in-comic: A wizard tells Abraham that every properly trained mage in the world is taught about Abraham, "the idiot apprentice who decided to enchant a diamond to cure his noble friend instead of selling it and getting aid from someone more experienced."
Also, the "abomination" in question? Had long since adjusted to her situation and become a beloved cast member. Meaning he was basically targeting an innocent just for existing. When this was first brought up, he remorsefully stated that the only reason he continued trying to kill her was because he was bound by an oath.
Amya: Vincent does his job because he needs to get paid - but when things start to go badly he doesn't hesitate to let his abductees loose.
Cassiel of Misfile is Satan's niece, and normally just bothers the main characters with Poke the Poodle evil plots (such as serving them sub-par snacks). When she decides to do nice things for her mortal friend, however, she ends up screwing things over pretty bad.
Captain Courage, of the Whateley Universe. He tries to be a hero, but he has so many illegitimate children and paternity suits that there are more wanted posters out for him than for most supervillains. In most places, he's now known as Captain Condom instead of his real codename.
The Simpsons: Mr. Burns unsuccessfully tried to be good. He tries his hand at recycling, and ends up using the plastic he recycled to overfish the nearby sea.
Lisa: When you try to be good, you're even more evil!
Fry: Now me and Leela are forming an awesome crime-fighting duo.
Bender: Wow, crime-fighting. Cool. You say you're a duo? Yeah duos are good. Of course sometimes they're a little short handed. See ya. With two humans you'd think there'd be a robot in there... to balance things out. But, whatever. I have these three costumes you could use. But, I guess I'll just throw one away.
Leela: We'd love to have you on the team Bender. But aren't you more on the supply side of crime?
Zapp can be this when he's not an antagonist. Disturbingly incompetent and overtly contemptuous of his own men, he launches a war of aggression For the Evulz in "War is the H-Word".
In Superman: The Animated Series, Bizarro thinks he's Superman, so goes around "saving" a building from what he didn't realize was a scheduled demolition, and "fixing" an opening draw bridge, thinking it was falling down, causing a ship to almost crash into it.
This sort of action was played for laughs in the Daffy Duck cartoon "Stupor Duck." Daffy, as mild-mannered Cluck Trent mistakes dialogue from a TV drama as a villain's arch plans, so as Stupor Duck, he rights a to-be-demolished building, stops a staged-for-filming railroad demolition, surfaces a legal submarine, and gets sent to the moon on a rocket.
In the episode "Zuko Alone", he fits the bill better than usually though. He's just beginning to find himself in that episode and gets reluctantly drawn into a conflict with some corrupt Earth Kingdom soldiers that are abusing their position in a small village. He struggles with not wanting to get involved (and of course hiding that he is a Fire Bender), but in the end, saves the day. Of course, his Crowning Moment of Awesome, when he tells the Earth Bender EXACTLY WHO just beat his ass, turns sour when the townsfolk (including the little boy he just saved) no longer want anything to do with him after seeing his Fire Bending. On top of that, the reason the boy was in trouble at all was because Zuko gave the child his own dagger as a parting gift and the boy threatened a guard with it.
To clarify, Zuko says this after he accidentally burns Toph. But in the Grand Finale, he is the second most important person in the world to end the war, after Aang.
Note that Zuko is pretty ineffective as a villain too, though.
Coop of Megas XLR. He's a good guy, and far from incompetent (but still within view of it), he's just a Destructive Savior to the nth degree. One episode dealt with some alien superheroes mistaking him for an outright villain, and their nemesis thinking he was trying to pull an Eviler than Thou.
Plastic Man in Batman The Brave And The Bold. Recently redeemed and enthusiastic about being a hero, but frequently exasperates Batman with his difficulties being competent and not stealing stuff.
Justice League: The Huntress gets herself kicked out of the League for attempting a revenge killing. Aside from that one time though, she does a pretty good job at being a Hero.
Jackie Chan Adventures, in the episode The Good Guys. Chow, Ratso, and Finn, tired of constantly losing to Jackie Chan, attempt to reform. At the end of the episode they go right back to being evil, saying "We're just no good at being good."