Right for the Wrong Reasons

"See, there were these two guys in a lunatic asylum. And one night, they decide they don't like living in the asylum anymore. They decide they're going to escape! So, like, they get up onto the roof, and there, just across this narrow gap, they see the rooftops of the town, stretching away into the moonlight. Stretching away to freedom. Now, the first guy, he jumps right across with no problem. But his friend, his friend daren't make the leap. Y'see... y'see, he's afraid of falling. So then the first guy has an idea... He says, "Hey, I have a flashlight with me! I'll shine it across the gap between the buildings. You can walk across the beam and join me!" But the second guy just shakes his head. He suh-says... he says "Wh-what do you think I am? Crazy? You'd turn it off when I was halfway across!""

- The Joker, The Killing Joke

Someone makes a conclusion based on what he perceives are facts. His conclusion is correct, his logic is (usually) fine, but the facts themselves are wrong.

The Gettier Problem is a well-known issue in epistemology that basically uses this scenario to mount an attack on the definition of "knowledge" as "justified, true belief" -- a conclusion reached this way is justified and true, but intuitively we wouldn't call it knowledge.

Compare and contrast Framing the Guilty Party, where the facts are known to be false, but the conclusion is still correct. Also compare Conviction by Counterfactual Clue. Can sometimes overlap with Accidentally Accurate when it happens on a meta-level. Dismissing the conclusion because of erroneous facts would be the Fallacy Fallacy. When the premises and the conclusion are correct, but the logic connecting them is completely insane, you have a Bat Deduction. For the direct inverse, where the logic and premises are perfectly sound, but the conclusion isn't, see Entertainingly Wrong. May be a reason for Don't Shoot the Message.

Comic Books

 * In Detective Comics #373, "The Riddler On The Roof", Elongated Man visits Gotham while Batman's busy elsewhere, and Comissioner Gordon shows him the Riddler's latest clue. He stops the Riddler shortly before Batman, who has finished his own case and seen the clue, shows up. However, when they compare notes, they have completely different interpretations of what the riddle means, although they both connected it to the same crime. Basically, either Batman, Comissioner Gordon, or both were Right for the Wrong Reasons—and out of sheer spite, the Riddler won't say which.
 * The Killing Joke, as quoted, has an example of a crazy person achieving this, showing just how far the trope can go. Wanna get philosophical about it? Try this on for size. The first crazy person is the Joker, just plain crazy, and destructively so to boot. The second? Batman. He's just as out-of-touch with reality, but as he has some vague understanding of who he's dealing, he can get by... sort of..
 * Alternatively, the first crazy person is Batman, who is crazy, knows it, and is doing something about it, and the second person is the Joker, who knows the other person is crazy and is being offered help but believes that it is given in bad faith.
 * Or that he's too far gone to be helped.
 * OR, the first one is the Joker, but because he was brave enough to make the leap into chaos and delirium. Batman is still trying to convince himself he's sane, and doesn't have the courage to embrace madness.
 * In Watchmen, unlike everyone else who just thinks of him as a benevolent philanthropist, Rorschach is very suspicious of Veidt, which turns out to have been warranted. However, this is because Rorschach has some very fringe right-wing views, and so he naturally assumes the Ambiguously Gay and nice liberal guy must be up to something evil.
 * Keep in mind the world they live in. Rorschach probably smelt a Stepford Smiler at work.
 * Rorschach knows that he's a man of only average intelligence and education, and knows that Adrian Veidt is the smartest man in the world and its most widely-talented polymath. If Veidt consistently acts like he is oblivious to things that are self-evident to even Rorschach's perceptions then either Rorschach is entirely wrong about the world or Veidt is hiding something, and the egocentric bias of any normal human being -- let alone a fanatic like Rorschach -- is going to make Rorschach leap straight to the second conclusion.

Film

 * There was a massive scene in Hot Fuzz where Nick Angell accused Tim Dalton's shopkeeper character of committing the murders, complete with motives. He didn't identify the correct motives, and the shopkeeper had a watertight alibi, BUT - and it's a big but - My brain hurts.
 * In Without a Clue. Holmes' (and Watson's) contrived method of solving the final clue turns out to be true, but the real solution is far simpler.
 * In Star Trek, Kirk connects several events that have occurred as meaning the Narada is attacking Vulcan, and even Spock says his logic is sound. He's right, but his conclusions such as "lightning storm in space=Narada" are wrong (the lightning storm being Spock Prime coming through a black hole in this instance, which Kirk simply can't know of at this point).
 * Bonus points for this being a double case. Kirk's desire to raise shields may be born out of his unwarranted certainty in his conclusion but the circumstantial evidence is enough to suggest that raising shields and proceeding with caution is still a good idea.
 * At the end of the Burn the Witch scene in Monty Python and the Holy Grail, it's revealed that the woman really is a witch, despite all the fabricated evidence and Insane Troll Logic the peasants have used against her. (Although considering what happened with the scales, it also turned out that at least some of said Insane Troll Logic was itself right.)
 * Also, in the middle of the Insane Troll Logic, there's another example. When someone suggested making a bridge out of the woman to see if she was made of wood (they reasoned that witches are burned because they're made of wood), the reason the idea was vetoed was because bridges could be made of rocks as well.

Literature

 * In Jingo, there's a type-3 Framing the Guilty Party, where the evidence they find is so stereotypically Klatchian that it's laughable. Colon and Nobby, naturally, conclude that since the evidence points to Klatchians, it must be Klatchians. Vimes, however, takes the "quality" of the evidence to mean someone in Ankh-Morpork is doing a bad job of framing the Klatchians for the attack.
 * In The Leaky Establishment by David Langford, Tappen has a Eureka Moment near the end when he connects  with a few other pieces of circumstantial evidence to conclude, correctly, that  . However, when he explains his chain of reasoning to Pell, Pell replies that.
 * A story in Sideways Stories from Wayside School has a character who always comes up with the correct number when counting, albeit by counting completely random numbers (example: "three, ten, nineteen, sixty-four, five. The answer is five!"), lampshaded by the teacher's odd reaction (nodding, but saying "No"). When told to count "one, two, three, four, five, six, seven, eight, nine, ten", he takes it to Literal Genie-level conclusions and counts all ten numbers regardless of the number of objects he's attempting to count, giving him "ten" for everything, resulting in him only counting right when he counts wrong and vice-versa, or something.
 * In the Wild Cards novel Inside Straight, Hardhat deduces that Noel Matthews's hidden superpower is shapeshifting because Noel was able to pass as an attractive woman during the exercise, and Hardhat would rather deal with Shapeshifting Squick than accept the Unsettling Gender Reveal. When informed of some of the facts, Hardhat drops his theory.
 * In Foucault's Pendulum during a discussion on the "four types of people in the world", this principle is lampshaded as the province of 'Morons'.
 * In Isard's Revenge, smuggler Talon Karrde visits the Errant Venture, the converted Star Destroyer belonging to ex-smuggler Booster Terrik. Terrik believes the visit is regarding one of Karrde's associates, Aves, getting his own ship. Terrik is absolutely correct about Aves getting a new ship (and also correctly identifying the ship he's getting), even spelling out his line of logic (which is partly based on the fact that Karrde came to his ship). Karrde's visit, however, has nothing to do with Aves or his new ship; instead, it concerns Karrde even invokes the name of the trope, saying "this is why you're dangerous Booster, you're right for all the wrong reasons."
 * Grand Admiral Thrawn makes a few of these. Thrawn's The Chessmaster and a Manipulative Bastard who is often magnificent, and usually he's spectacular at gauging what any given individual will do in response to the situation, explaining to his Ishmael why. As the trilogy goes on and unforseen events crop up with more regularity he starts being wrong about they why, but still right—until the end, when he's not.

Live Action Television

 * In an episode of Star Trek: Deep Space Nine, O'Brien's wife thinks some footage of him is fake because he does not drink coffee in the evenings, which he is doing in the video. The footage is fake, but when he gets back safely one of the first things he does is ask for a cup of coffee, since he does drink it in the evenings.
 * Law and Order's ADA Southerlyn was fired not because she was a lesbian, but for becoming convinced a defendant was innocent essentially due to white guilt, and spending most of the episode playing for the other team.
 * Gregory House came up with an effective treatment for a soap opera actor's quinine allergy while convinced that the patient had something else. Cuddy was called out by an inspector for giving him as much leeway as she did. Which included, um, kidnapping the patient.
 * On the Game Show One Versus a Hundred, a contestant was give the question, "How many US states do not touch any other state? One, two, or three?" Thinking out loud, the contestant said that Hawaii is in the ocean, and one of the Great Lakes states is completely surrounded by lakes, so the answer must be two. The answer is two, but it's because the two states in question are Hawaii (which is indeed surrounded by ocean) and Alaska (which borders northwestern Canada).
 * In Are You Smarter Than a 5th Grader?, one woman was asked "True or False: The female seahorse carries her baby in a pouch". Although seahorses are quite famous for the males doing this, her answer was no, because she'd never seen a pouch on a seahorse. (Which raises the question as to how many seahorses she's seen!)
 * On the Brit game show Perfection, which is all true/false questions, this tends to happen at least Once an Episode.

Newspaper Comics

 * In this episode of Pickles, nice old lady Opal is inspired to learn how to make a website by the saying, "Rome was built in a day".
 * This Dilbert comic.

Other

 * In Professor Stewart's Cabinet of Mathematical Curiosities, he uses the sum 1/4 X 8/5 = 18/45 as an example of the result being right (18/45 can be simplified to 2/5, the correct answer), but the methodology being completely wrong.
 * In You Fail Logic Forever, there's this example: "Take the fraction 16/64. Now, canceling a six on top and a six on the bottom, we get that 16/64 = 1/4." It's an example of the Fallacy Fallacy, where saying that you can't simply cancel the sixes is treated as saying 16/64 =/= 1/4
 * This also works with 19/95, canceling out the nines to get 1/5. Right for the Wrong Reasons, again.
 * Some of my friends gave those two above as examples, and said that you could always do this to an extremely gullible kid. To his credit, he tried to think of a counterexample. However, he came up with 26/65...
 * An old joke: Three old men go to the doctor for a checkup (please don't ask why the doctor is giving all three men their checkup at the same time). Since they're getting on in years, the doctor decides to check their mental faculties as well. So he asks the first man, "What's three times three?" And the old man says, "273." So the doctor moves on to the second guy and asks the same question. "Tuesday," is the reply. Finally he asks the third old man. "9." "That's great!" says the doctor, "How'd you get to that answer?" "I subtracted 273 from Tuesday."

Video Games

 * In Rosenkreuzstilette, Spiritia finds out that the RKS's rebellion was indeed a waste of time and a potential downer for human-Magi relations,
 * In Disgaea 2: Cursed Memories, Rozalin comes to the conclusion that her "father", "Overlord Zenon" is a fake for completely arbitrary and selfish reasons. It's helped by the fact that he doesn't exactly deny it when she confronts him, but she completely misses all the real hints that her father really is a fake.
 * Early in Ghost Trick, the protagonist and Ghost Amnesia sufferer Sissel learns his name as he infiltrates a foreign base where the people present call him by that name while viewing data on him. It turns out that.
 * Ace Attorney does this a lot, often realizing the culprit before fully understanding their motive or method. The most notable is —she actually did
 * In the same case, Wendy Oldbag decides that is a terrible person because . The premise? Completely incorrect. The conclusion? Completely accurate.
 * In Mass Effect 3, during the first part of the game, one of the ongoing conversations that a player can eavesdrop on is an Elkoss-clan volus by the name of Rupe talking with a human woman named Sarah about "Sanctuary", the much-advertised "safe haven" from the war. Rupe Elkoss gives several reasons as to why Sanctuary is obviously a fraud, all based on his presumption it's some amoral, unscrupolous businessman seeking to make money off of people's fear.

Web Comics

 * Quentyn Quinn from Tales of the Questor believes that a bunch of human coins are forged because the heads face the wrong way. Unbeknownst to him, the direction the heads face is irrelevant, but the coins are indeed fakes.
 * The premise of Request Comics #23.
 * Touched upon in this episode of Dinosaur Comics
 * Also seen in this Xkcd.

Web Original
"Sarge: Alright, men. Stand down. Grif: Stand down? We outnumber them three to two. That's like a three with a two. That's... 32% advantage... if you carry the one. Simmons: I don't want to know how you came up with that, but you're actually right!"
 * Used in Red vs. Blue Reconstruction, when the reds are fighting Washington and Church.

Western Animation

 * In an episode of King of the Hill, Peggy gets a lawn gnome which Hank despises, so when Bobby accidentally damages while playing Hank uses this as pretext to get rid of it. Feeling guilty at Peggy's panicked reaction, Hank confesses but claims he did the whole thing. Peggy correctly guesses that he's lying to protect Bobby, but wrongly believes that Bobby is wholly to blame and thus punishes him very harshly. Later on, Hank goes out and buys a new gnome, then gives it to Bobby to try and smooth things out. Again, Peggy figures most of this out, but assumes that Hank did it out of pity rather than guilt, ultimately deciding that Bobby's been in the doghouse long enough.
 * In season 2 finale of My Little Pony Friendship Is Magic, Twilight Sparkle is suspicious of Princess Cadance, her old foal-sitter and her brother Shining Armor's bride-to-be. Twilight becomes convinced by Cadance's ill treatment of the other Mane Six who are helping with the wedding preparations and the sight of Cadance casting a suspicious-looking spell on Shining Armor that Cadance has turned evil.

Tabletop Games

 * In the Pathfinder adventure path Kingmaker the character Jhod Kavken incited a lynch mob to kill a supposed werewolf, only for the real killer, who was not a werewolf, to be caught by accident hours latter. He is only exiled for this crime instead of many possible worse punishments because the victim of his lynching was actually a bandit come to scout out the town and his death scared off an actual attack.

Real Life

 * During the plague epidemics of Europe from the 17th to the 18th century, plague doctors used a protective garment of thick waxed- or greased-fabric overcoat, gloves, leggings, boots and a head cover with a mask fitted with glass eyepieces and a beak filled with aromatic herbs to filter the air. People were convinced back then plague spread itself through contaminated air. As plague spread from rats to humans via fleas, the primitive gas mask of the beak was useless in this respect - but the all-enveloping thick clothing still kept fleas away from the body and the mask kept them away from the face, increasing slightly the chances for the plague doctor to escape unharmed.
 * While it gave rudimentary protection to the doctors, the fact that this costume was rarely cleaned, along its voluptuous layers of cloth ensured that the doctors carried bodily fluids and other filth from wherever they had visited on their robes, making them inadvertently spread the plague wherever they went. The widespread superstition at the time that the visit of a doctor was a sign of impending death wasn't far off the mark.
 * And another thing - while they correctly deduced that some diseases travel through the air, they had no knowledge of microbes at the time, and assumed that diseases were caused by bad smells. That was the reason for the herbs in the beak.
 * Similarly, Victorians believed malaria was caused by bad (mal) air. Missionaries in Africa wrote home about the primitive superstitions of the natives, who foolishly believed malaria was caused by evil swamp spirits. Both groups were wrong, but closing your windows at night and staying out of the swamp is a very effective way to avoid mosquitoes, which are the real vector of the disease.
 * In a way, the mosquitoes can be seen as evil swamp spirits. Especially if there are many of them attacking you.
 * Conservapedia founder Andrew Schlafly has started the "Conservative Bible Project", an attempt to remove what he perceives as "liberal bias" from the Bible. (It is exactly as blasphemous as it sounds.) One of the stories he has removed from his version is the adulteress story, on the grounds that it could be used as a justification to sleep around. Amusingly enough, he's actually right this time. This passage is currently believed by scholars not to have been in the original documents (albeit not for the same reasons Schlafly thinks).
 * Mongols believed that boiling water would appease the water spirits and keep them from cursing them with sickness. An amusing thought occurs that driving off germs wouldn't sound any more odd to people used to thinking about spirits but who never thought of germs. Sort of like Playing With Arbitrary Skepticism.