Many works, and installments of works, have shocking or unpleasant twist endings. For instance, the Mystery Episode may reveal that the vampire was actually a con man, only for an actual vampire to show up, or the Sick Episode may end with the character recovering, only for another character to get sick. However, sometimes it then reveals that everything is hunky-dory after all, and that's what the Shock-and-Switch Ending is.
Going on for the above hypothetical examples, maybe the "vampire" then reveals himself to be another conman, or the "sick" character actually just has allergies. This is basically when a work seems to be headed for a Happy Ending... only to apparently take an unpleasant turn... and then, it turns out to actually be a happy ending. You could see it as a Double Subversion of Happy Ending.
This is a good way for the writers to have their cake and eat it too when it comes to endings, and is a good source of humour as well. It's also a good way to make sure a serial work's actual shocking twist endings stay shocking— the viewers never know whether you'll actually make something bad happen or fake it.
It's a common way to subvert Sudden Downer Ending, Here We Go Again!, Real After All, Maybe Magic, Maybe Mundane, Fright Beside Them, Ambiguous Ending, and Or Was It a Dream?, and it may double-subvert "Scooby-Doo" Hoax. If it's in the form of having a character be joking, the others will usually either have a Dude, Not Funny! reaction or it'll result in an "Everybody Laughs" Ending. See also Cat Scare, "Shaggy Dog" Story, Big Damn Heroes, Daydream Surprise, and Scary Shadow Fakeout. Can overlap with Fourth Wall Psych if this is used to subvert The Fourth Wall Will Not Protect You, Disney Death if it subverts Character Deaths, and All Just a Dream if it's revealed to be a Nightmare Sequence. Compare and contrast "Ray of Hope" Ending, which is still a sad ending but there is a slight chance of hope, and Gainax Ending, where the ending is a Mind Screw instead of a comedic subversion of expectations. See Fission Mailed for the video game version.
Warning: This is an ending trope, so expect spoilers.
- Mario and Sonic: Heroes Unite!: Chapter 43 seems to end on a downer: Mario and Sonic are trapped in a force field, Eggman pushes the Big Red Button on his Doomsday Machine, doing his trademark Evil Laugh, the missiles are aiming straight for Mario and Sonic... this looks like the end for our heroes... when all of a sudden Metal Sonic shows up, completely unharmed from the missile blast that hit him. He then releases Mario and Sonic from the force field surrounding them—simply because Mario is necessary for his plan, nothing more.
- The Pony POV Series: At the climax of the Dark World, the Elements of Harmony are used against Nightmare Eclipse/Paradox and her team of Nightmare Psycho Rangers, only for them to counter with their corrupted Elements, which unleash a World-Wrecking Wave that obliterates Dark World and kills everyone except Twilight who crosses the Despair Event Horizon and agrees to become Paradox. Fortunately, Word of God has confirmed that this isn't the real ending; the fact that that entire last portion is written in italics and suddenly features a character who's dead by that point, it's implied that this is actually a scene from a previous iteration of Dark World.
- Turnabout Storm: Phoenix loses the case, Rainbow Dash is declared guilty, and the screen fades to black... OBJECTION! Fluttershy barges into the courtroom with a testimony that gives the defense a new lead.
- The Croods features an in-universe example: Guy tells a story about a tiger and it ends with the tiger peering off the cliff, slipping, falling... and flying.
- At the end of Shrek 2, it appears as though King Harold has died, but really he has turned into a frog... and he was born as one anyway. Also a sort of pun, since he "croaked", but not in the way they expected.
- The title character of Birdy is mentally ill (verbally unresponsive and seemingly shell-shocked from The Vietnam War), obsessed with birds, and currently hospitalized. He and his friend Al Columbato escape to the hospital roof, but Birdy breaks free of his friend, runs to the roof edge, raises his arms, and jumps off. Al is in shock, expecting that Birdy has leaped to his death, and runs over — but discovers that his friend simply jumped the short distance over to the neighboring building's roof. Birdy calmly looks back at Al in puzzlement and says, "What?" as the movie ends.
- Fortress (1992) ends with a Post-Climax Confrontation in which the evil prison computer Zed-10 reveals to have taken over a truck and attacks the surviving characters (Nino, Brennick and his wife Karen who is giving birth in an abandoned barn). Nino gets run over but Brennick fights off the truck unloading all the bullets of his BFG until hitting the camera of the truck, and then setting it on fire with the flamethrower. However, burning the truck causes it to crash directly into the barn where Karen was last seen and blows it up to kingdom come. But just as Brennick is about to break down into Manly Tears, it's revealed that Karen managed to get out of the barn in time and successfully gave birth to their baby.
- Get Out (2017) ends with Chris finally having escaped from the mansion and strangling Rose for trying to lure him to a Fate Worse than Death, when a police car rolls up. Rose immediately starts to play the victim to spite Chris, only for the person to walk out of the car to be Chris's best friend Rod, who's come to rescue him. In the original ending, Chris really would have been arrested for murdering Rose, but this was changed because it hit a little too close to home and a more escapist conclusion replaced it.
- In Train to Busan, the last two survivors are spotted by a military barricade that, due to the darkness and unsteady gait of the survivors, are preparing to shoot them. A few minutes of the soldiers preparing to open fire is stopped when one of the survivors tearfully sings a song she dedicated to her late father, preventing a Kill 'Em All ending.
- Killer Ending initially seems as though it has concluded with killer and psychopath Caroline having manipulated the investigation into her abduction of Sarah Sayers, daughter of crime writer Agatha Sayers, to make the world believe that Agatha did it all for publicity for her latest book and then killed herself after leaving everything to Caroline in her will. However, it's soon established that Caroline is actually living in a mental asylum, having suffered a complete psychological breakdown so that she just thinks she's meeting with an agent for her book when she's actually having sessions with the chief psychiatrist.
- Harold and Maude: Following Maude's death, Harold goes tearing off in his car, and the viewer sees it go flying over a cliff and crash in wreckage below. Then the camera pans and shows Harold watching with his banjo. He strolls off, playing as he goes.
- In Grumpy Old Men, John has a heart attack walking home from the bar. The last shot we see of him is talking to his new flame Ariel being heavily intubated, looking like he's on the brink of death. Several scenes go by after this (including his frenemy Max and his son helping to pay off John's IRS debt to avoid them taking his house), and then the final scene has all the men of the movie in what appear to be mourning clothes outside of a church, making it seem like they're going to John's funeral...and then they remove their outer coats to reveal tuxedos, and that they're groomsmen in John's wedding to Ariel.
- In The Stinger of the film adaptation of Hideaway, the villain Jeremy/Vassago is medically revived AGAIN at the hospital, whereupon he immediately murders a nurse — and then it's revealed to be a nightmare the hero Hatch is having. As his wife comforts him, he's realizes this is like the ending of Carrie (1976), and the couple briefly indulge in their mutual mutual movie trivia game as they go back to sleep. Also qualifies as a subversion of Sequel Hook.
- Both Wayne's World movies have miserably unhappy endings — before Wayne and Garth address the audience to say that they're not really going to end them that way. From there, they try out a silly alternative ending (a Scooby-Doo one in the first film, a recreation of the ending of Thelma & Louise in the second) before presenting the actual and accurately named "mega-happy ending".
- Chester: Zigzagged. Melanie tries to write a story about a mouse, then Chester interrupts the story to make it so the mouse went on a trip and never returned and he (Chester) moved in. Melanie ends the story by having the mouse return after all and bring a dog as a souvenir, making a big point of the fact that the dog has teeth. However, Chester adds a second ending specifying that the dog only eats carrots.
- For people who read the Twilight book series, the scene near the end of Breaking Dawn where quite a few characters die is an absolute shocker. Once the scene completes, we see it was a vision Alice saw of the future, invoking this trope.
- Redshirts ends its main story with one of these, with the next-to-last chapter ending with the starship Intrepid getting destroyed by a meteor strike; the last chapter states that actually, that didn't happen and the ship and crew are fine.
- 1000 Ways to Die: Subverted. The show has a segment where the victim is a man whose home gets broken in and the thief throws him off the balcony. Then we see the usual recap and the screen that numbers and names the death: "Homie Invasion"... then a record scratch happens and the narrator quips "Wait, it cannot end like this!". Turns out the man suffered from Lazarus Syndrome and raised up after a moment. He wandered back into his house and, when the thief sees him alive again, he gets so scared he ends up falling over the same railing. The screen is shown again, though now the death is renamed "Homie's Dead".
- The final episode of Dallas's 1978-1991 run ended with Bobby walking in on J.R. just as he seemingly shoots himself. The 1996 reunion movie J.R. Returns opens revealing that J.R. actually shot a mirror (he was hallucinating a demon in the mirror taunting him to kill himself).
- In the final scene of Avenue Q, it seems like the characters' arcs are resolving happily. Then they wonder where Rod is. Cue the sound effect that sounds like a gunshot... and Rod happily coming out holding a freshly popped bottle of champagne! May be an homage to the ending of The Apartment, in which a champagne pop is mistaken for a character's suicide in the final minutes but very quickly cleared up.
- Invoked in Protectors of the Plot Continuum, where secret agents enter stories (namely badly-written fanfiction) with bad or disturbing endings and change reality so that the stories have happy endings.
- In the Twisted Translations video covering the badly-translated "Total Eclipse of the Heart", the song ends with the title being mistranslated as "Heart Attack", accompanied by the singer exclaiming, "Heart attack! Oh no!" and passing out. However, she then pops up hunky-dory.
Is anyone gonna call 911? ... Never mind.
- In the Engie Benjy episode "Gobstoppers", several of the sentient vehicles' engines break down. Engie Benjy fixes them with gobstoppers, but then it seems as though Jollop the dog is sick... then, it's revealed he was only Playing Sick to get a gobstopper.
- Franklin: One episode is about Franklin trying to get his toddler sister Harriet not to call everything stupid. It seems like she's going to do it again at the end, but she instead says, "This dinner is... yummy".
- The Loud House:
- "Project Loud House" makes it look like Lincoln is about to get into the van for school, only for his diorama to break... but then, his sisters tell him that it'll all be fine and the real last scene is him giving a speech about family, with his sisters posing as the diorama.
- "Butterfly Effect" looks like it'll end with Lincoln being eaten by a giant Lily, but then it turns out to all have been a Fantasy Sequence. This not only cancelled out the bad ending, but it undid all the other bad things that happened during the course of the episode, such as Lucy becoming a vampire and Lola's face being disfigured.
- In an episode of Martha Speaks, Carolina turns into a dog. The episode seems to end with Martha narrating that Carolina stayed a dog for the rest of her life, but then Helen tells her off. Turns out that the real ending was that it was All Just a Dream.
- In an episode of Master Raindrop, Shao Yen turns evil and develops an Evil Laugh. At the end of the episode, it seems like she's still evil because she does her evil laugh, but then it turns out she's just joking.
- The My Little Pony: Friendship Is Magic episode "The Crystalling" focuses on a baby with dangerous, uncontrollable magic. At the end of the episode, she's about to sneeze and everyone prepares for the worst... but when she sneezes, nothing happens.
- In "Boxing Day", a mess-up with the technology results in several people and things being trapped in boxes. At the end of the episode, Three is in a box, making it seem like the troubles aren't over, but then it turns out that she got into the box on purpose to scare Four, Five, and Six as a prank.
- In "The Dreaded Lurgi", Four and Six, and later Three all get the eponymous disease, with one of the symptoms being sleepiness. At the end of the episode, everyone has recovered, but Zero falls asleep. Four is worried that Zero has the lurgi but Five confirms that Zero is just being his usual Sleepyhead self.
- Downplayed for the ending of "All's Well That Pretends Well": It seems as though the babies have caught Angelica's cold, but actually they were just pretending. The issue of them being unable to go to the circus is also solved when Drew reveals that they have it taped on video. However, Angelica still genuinely has a cold.
- Attempted in-universe in "Ghost Story". The kids are, as the title would suggest, telling a Ghost Story and Chuckie tries to end it with the protagonist going into a dark room in an apparently-haunted house, only for it to be revealed that the house wasn't haunted after all. He also adds pillows and candy. Angelica, however, tells him that he can't end a ghost story that way, so he makes it so it's no longer the end, and changes it so the pillows are hard and the candy is yucky.
- The Simpsons:
- "Two Dozen and One Greyhounds" ends with Marge entering the basement and gasping in shock while we see Homer's shadow suspended above the floor swaying back and forth, implying that he hung himself. We then see that Homer is actually holding onto one of the rafters while swatting at a light bulb.
- In "Dog of Death", Grampa Simpson tells the rest of the family that Santa's Little Helper is dead, and the show goes into a commercial break over a shot of the dog's motionless body as sad music plays. The episode resumes with the exact same shot, except the dog is now breathing and the Simpsons are admonishing Grampa for declaring him dead (though he continues to insist that the dog's dead).
- At the end of the Sonic Underground episode "Bug!", Manic has been freed from the mind control that the titular bugs had put him under, only to suddenly lapse back into it. As his siblings rush to his aid, Manic deadpans "Gotcha", revealing he was just pranking them. Cue Everyone Laughs Ending.
- Sponge Bob Squarepants:
- In the episode "Sailor Mouth", when everyone seems to have learnt not to swear, it seems as though Mrs. Krabs has sworn. In reality, though, it's just a car horn (since in Bikini Bottom, people swear with sound effects).
- In "Dying for Pie", Spongebob apparently eats an exploding pie and is Mistaken for Dying, but at the end it's revealed that he didn't. However, he then drops it and the pie explodes anyway... but then Squidward says, "Ouch!", implying that they're not dead.
- The Transporters: One episode has William being lethargic, and it turns out to be because he has a broken cog. At the end of the episode, Dan looks tired... but that's just because he's had a busy day.