The premise of the Cuckoo Nest plot is that a character is convinced that they are in an insane asylum (a BedlamHouse is a popular choice), where they are told that the events of the series are actually hallucinations.

The episode will switch from "reality" to reality, [[MindScrew making one wonder]] what's really happening. Sometimes, even if the series canon reveals that someone was using {{phlebotinum}} to make them think they were crazy, there will be a scene in the "real world" of a psychologist giving up.

Often, if the character "accepts" the "insane asylum" reality by doing a certain thing (taking a pill, destroying the source of his "fantasy" power, et cetera), they might die, lose their power, or be submerged in the new non-fantasy reality forever. Occasionally the character is encouraged to kill themselves in order to wake up. The character is eventually persuaded to do said thing, and they're only stopped when incongruity reveals they're the subject of an elaborate ruse.

There's a variation on this, an ending to a movie/video game/book (they don't usually have the guts to do it to an entire series) where the [[TwistEnding final reveal]] is that the whole thing ''was'' just the delusion of an insane person -- a combination of this trope, AllJustADream, and DyingDream. Don't do this unless you really, ''really'' know what you're doing, and [[SturgeonsLaw even then you probably shouldn't]]: done even the slightest bit poorly, it feels like the author has played an annoying prank on the reader, and worst yet, an unoriginal one.

More ambiguously, the issue of which is "real" [[SchrodingersButterfly might never be resolved.]]

The Cuckoo Nest is the dark counterpart of the LotusEaterMachine. A more benign form of the Cuckoo Nest is the HappyPlace. A more sinister one is ThroughTheEyesOfMadness. A version without the imaginary "reality" is [[GoAmongMadPeople going among mad people]].

Not to be confused with ''Literature/OneFlewOverTheCuckoosNest'', or with "[[WhosYourDaddy a cuckoo in the nest]]".

----
!!Examples:

[[foldercontrol]]

[[folder:Anime]]
* Episode 14 of ''Anime/TheBigO'' was one of these, although another possible explanation is that the character involved was temporarily transported to an actual alternate world.
* ''GaoGaiGar'' has a MonsterOfTheWeek try this on Gai. It lasts for about a minute.
* The final season of ''Anime/YuGiOhGX'' culminates in the supernatural entity Darkness locking most of the supporting cast in a neverending nightmare where all their dreams are broken. When they ultimately give up on life, they are consumed by Darkness and become one with it. Judai saves them with some crap about cards.
* Very briefly used in ''Anime/PerfectBlue''. One of the hallucinations indicates that Mima's DetectiveDrama character is the real person, and her "Mima" identity was fabricated as a coping mechanism to deal with being raped in a strip club. [[MindScrew At least, it was probably a hallucination.]]
[[/folder]]

[[folder:Comic Books]]
* ''ComicBook/FallenAngel'' #14 directly references the ''Series/{{Buffy|The vampire Slayer}}'' episode. In this case, it seems like the character in question really ''is'' in a mental hospital, and is hallucinating the faces of the book's cast over the people there; at the end, it seems like she moves between dimensions, back to the series's universe.
* Creator/GrantMorrison's final issue on ''Comicbook/DoomPatrol'' centres on Crazy Jane in a mental hospital, where one of the supervising doctors, convinced all of her Doom Patrol adventures have been delusions, subjects her to electroshock and discharges her to live a humdrum "normal" existence. However, [[spoiler:in the end, teammate Cliff Steele saves her from suicide by taking her "home" to the utopian [[GeniusLoci Danny the World]].]]
* A ''[[ComicBook/TwoThousandAD 2000 AD]]'' story "Dead Signal" features a BountyHunter in a futuristic setting, who may be the delusion of an amputee back in the real world.
* ABCComics' ''ComicBook/TomStrong'' had one of these. It began with a standard adventure, which went into "It Was All A Dream" and he woke up to his life as an unhappily-married factory worker in a [[WelcomeToTheRealWorld gray world with no superheroes]]. Then inconsistencies in his life lead him to discover that he has superpowers - but that he is a [[PhlebotinumRebel failed military experiment]] and his entire superhero life is just as much a delusion as his normal-schmuck life. Then he breaks out of the delusions back to his real superheroic life. The villain's plot failed because the gray world Tom Strong had been hallucinating lacked hope, and Tom couldn't give up hope.
* "Mask", a two-part story in ''Legends of the Dark Knight'', showed Franchise/{{Batman}} waking up as a scrawny Bruce Wayne in an asylum. His psychiatrist explained that he had retreated into fantasy after the death of his parents. [[spoiler: As it turned out, the psychiatrist was the vengeful son of one of Batman's enemies.]]
** [[spoiler: However, the story ended with alternating scenes of Bruce standing tall and strong as Batman over Gotham after finally freeing himself, and of scrawny Bruce Wayne still in the hospital and being labelled brain dead.]]
* Creator/ScottMcCloud's ''ComicBook/{{Zot}}'' has a story called "Season of Dreams" in which the main character Jenny gets trapped inside gigantic robot called Zybox, which induces her into an artificial dream in which Zot and all her adventures with him were just mere delusions caused by a severe depression after the divorce of her parents.
* ''ApollosSong'' by Osamu Tezuka may well fit. For killing animals that show affection to their young, Shogo is placed in a mental hospital. EST causes him to have an out-of-body experience wherein he meets Athena, who curses him to live numerous lives of ill-fated love. Which he does, waking up each time he dies finding that it was all his imagination (or was it?) triggered by a treatment (EST, hypnotism, etc)
[[/folder]]

[[folder:Fanfic]]
* There is a ''Manga/RanmaOneHalf'' fanfic called "[[http://www.fanfiction.net/s/3259192/1/Waking_Up Waking Up]]" in which all the characters slowly discover that all of the fantastic elements of the series (KiAttacks, MartialArtsAndCrafts, Ranma's [[ForcedMarriage engagements]] and Jusenkyo Curses) and parts of their personalities (Akane's anger, Ranma's ego, Nabiki's love of money) were delusions caused by chemicals the legitimately crazy Kodachi was putting into the town's water supply. They spend part of the story trying to adapt.
** There's another, "[[http://pixelscapes.com/twoflower/fanfic/WickedGarden.txt Wicked Garden]]", by [[http://pixelscapes.com/twoflower Stefan Paul Gagne]], which follows Kodachi becoming progressively more powerful through gene-spliced roses intercut with scenes of a little girl telling her that none of this made sense and that she'd fail soon. The fic ends with her finding that she's been hallucinating the events of the fanfic due to a failed formula.
* An ''Literature/{{Animorphs}}'' fanfic did this with Ax, the entire asylum scenario being a fevered dream (OrWasItADream) he experiences during ''The Sickness''.
* PlayedWith in ''FanFic/FalloutEquestriaProjectHorizons''. [[spoiler:She's in a virtual insane asylum that's part of a real insane asylum that's attempting to treat her insanity. She was not hallucinating the wasteland. They were trying to help her accept the fact that she killed an innocent.]]
* Happens in the second SeasonFinale of the ''Fanfic/PonyPOVSeries''. [[spoiler:Twilight wakes up in an insane asylum and is told she killed Trixie and has been committed. However, it turns out this is all an attempt by Trixie's EnemyWithin, [[BigBad Loneliness]] to break her so she can't succeed in her mission to free Trixie from both Loneliness and Trixie's Discording. Twilight realizes this by seeing that the asylum is basically a TV version of one, not a real one.]]
* ''Fanfic/{{Asylum}}'' is centered around this happening to Twilight Sparkle, with the other members of the Mane Six appearing as inmates or workers at the mental hospital as well.
[[/folder]]

[[folder:Film]]
* ''Film/TheCabinetOfDrCaligari'' used this as its TwistEnding, but this was back in 1920, [[OlderThanTelevision before it was cool]].
** There's some evidence that this ending was inserted later by ExecutiveMeddling. Apparently the German film making company thought that a movie about an old guy conditioning a young guy to kill on command might be in bad taste in the aftermath of WWI.
* ''Film/TotalRecall1990'' has a scene where a doctor arrives and tries to convince the hero that he is trapped in an artificially created hallucination. He insists that the hero swallow a pill to return to reality, but the hero notices a drop of sweat falling down the doctor's face, exposing the sham. Ironically, the film teases that most of the film really does take place in the hero's head, and the doctor scene was just part of his spy thriller [[SchrodingersButterfly memory vacation]]. Everything the doctor warned about in his speech ("One minute, you're the savior of the rebel cause; next thing you know, [[spoiler:you'll be Cohaagen's bosom buddy...You'll even have fantasies about alien civilizations...]]") happens after that scene. Before Quaid goes under the machine at the start, one of the techs says [[spoiler:"Blue sky on Mars..."]], which is in fact how the movie ends. Another interpretation is that the doctor scene was NOT a part of his spy thriller, but was actually a real attempt by a real doctor (and his real wife) to snap him out of a fantasy gone wrong.
** [[spoiler:Subverted in the]] original short story (''We Can Remember It For You Wholesale'') when the main character has his memory altered to believe that only his existence is preventing the takeover of Earth by aliens[[spoiler:, only for aliens to appear at the end and reveal that this is true]].
* At the end of ''Film/{{Brazil}}'', when the protagonist is interrogated by the baddies, there is an action sequence in which [[spoiler:he gets rescued by [[LaResistance the resistance]] and gets to live happily ever after with his girlfriend in a house in the countryside]]. Then it swings back to him [[spoiler: singing quietly to himself strapped while to a chair in the room he was being [[ColdBloodedTorture tortured]] in before his rescue. The torturer present remarks to the chief interrogator that he seems to be lost to them, and they leave the room, the final shot being the protagonist, tied up in a chair, singing quietly to himself, lost in insanity.]] A [[ExecutiveMeddling studio-mandated]] alternate happy ending ditched the twist.
* ''ReturnToOz'' had fun casting doubt on whether Dorothy's adventures in [[Film/TheWizardOfOz Oz]] were real or hallucinations.
* ''Film/{{Gothika}}''
* In ''Abre Los Ojos'' and its American remake, ''Film/VanillaSky'', the main character is told that he's [[spoiler:living in a virtual reality machine and he has to kill himself to get out. In a subversion, he jumps off a building, and it's ''true''.]]
* ''Film/PsychoBeachParty'' ends like this, with the lead character waking up in an insane asylum. The camera pulls back to show that the events have actually taken place in a drive-in movie. Characters watching remark on how lame the twist ending is, [[spoiler: until they are stabbed by the alternate personality of the protagonist.]]
* ''Film/TwelveMonkeys'' had its protagonist confused as to whether he had really come from the future, or was just insane. This gets to the point where his former psychologist and now traveling companion believes his story even when he's convinced it's false, although his conviction may just have to do with him falling for the past, which is much more pleasant than the future until TheEndOfTheWorldAsWeKnowIt.
* In ''Film/ShutterIsland'', [[spoiler: the entire plot was fabricated by the main character's psychologists, to get him to break his delusions and accept reality.]]
* ''Film/{{Inception}}'' has a variation on this trope - [[spoiler: After entering and living in limbo for several decades, Cobb "incepted" his wife with the idea that her world wasn't real, in order to get her to come out of limbo with him. It did not end well.]]
[[/folder]]

[[folder:Literature]]
* Creator/KeithLaumer's ''Knight of Delusions'' (also published, confusingly, as ''Night of Delusions'') puts its hero through an insane number of alternate realities. Every time it becomes entirely unbelievable, he gets put into yet another one and is back at square one, trying to figure out if he's completely out of it, or if he's stuck in yet another false reality. And they try ''everything'' to find one that he'll stop mucking up; PI, crazy senator, psychic defender of mankind, a scientist with a LotusEaterMachine, a homeless bum, ''God'', and a good half dozen more at least. [[spoiler:Finally the reader's told he's president and the whole deal was a test being given by aliens to see if [[HumanityOnTrial Earth was mature enough to join the rest of the galaxy.]] ]]
* A short story in the ''Let the Galaxy Burn'' collection set in the ''TabletopGame/{{Warhammer 40000}}'' universe contained this. The story begins with a powerful Tzeentchian Chaos Lord inviting a fellow Chaos Lord to his stronghold, and expounding his conquests and victories throughout his ten millenia. The visiting Lord, however, sets a trap to kill him, and the Lord awakens in the body of a lowly human Cultist, being taunted and pelted with stones by others for his failings. They perform a ritual to mutate him into an animal-minded Chaos Spawn, and as his body is ripped apart the only thing he can think of is which life was his.
* At one point in [[Creator/IainBanks Iain M. Banks]]'s ''Literature/ConsiderPhlebas'', [[VoluntaryShapeshifting shape-shifter]] protagonist Bora Horza Gobuchul is knocked out and dreams/remembers waking from an immersive training simulation when he was much younger. The person tending to him tells him what a great job he had been doing in the training, then calls him by the wrong name, and when Horza points this out, the technician suddenly seems concerned and implies that the Horza identity is just [[BecomingTheMask another mask that he has forgotten he was wearing]] before putting him back in the machine. Horza wakes up, and it's never mentioned again until the very end when [[spoiler: his counterpart from Literature/TheCulture is looking down at this dead, true form and wonders who if she ever actually knew the real person beneath all his assumed identities]].
* The Ben "[[WebAnimation/ZeroPunctuation Yahtzee]]" Croshaw novel ''[[http://www.fullyramblomatic.com/features/fogjuice.htm Fog Juice]]'' has the main character being shown by the BigBad that [[spoiler: he is lying in a hospital bed with a drip in his arm, and all the other characters are a drug-induced delusion. He dismisses this as the BigBad trying to talk him into giving up... and tries not to think about the stabbing pain in his arm]].
* In an early version of ''Literature/JohnDiesAtTheEnd'', Dave looks in a mirror while under the effect of [[PsychoSerum Soy Sauce]], and sees an overweight and insane/retarded version of himself, saying almost exactly what he says later to John.
* Much like ''Literature/{{Neverwhere}}'', Creator/RobertAHeinlein's ''Literature/GloryRoad'' and one of Terry Brooks's ''[[Literature/MagicKingdomOfLandover Landover]]'' books have the protagonist being told at one point that all of their fantastical adventures were a hallucination and that they are crazy and/or derelicts. In all cases, these scenes are presented as kind of a "last temptation" kind of thing, but you never know...
* Much of the first ''Literature/ChroniclesOfThomasCovenant'' trilogy focuses on the protagonist's uncertainty over whether the Land is real or not. His resolution of the problem still leaves the question open.
* The ''Series/DoctorWho'' short story "Nothing at the End of the Lane" in the anthology ''Short Trips and Side Treks'' does this to Barbara Wright. Since the concept behind the book is to explore non-canonical concepts, it leaves the question of whether Barbara is has been attacked by a mind-parasite on an alien world, or is a schizophrenic suffering hallucinations as she tries to protect one of her students from her abusive grandfather completely open.
* This is attempted on the protagonist of ''Literature/{{Glasshouse}}'' (by Creator/CharlesStross) in order to convince them that their past as a soldier and black-ops specialist was merely the fevered imaginings of an immersive game addict. When this fails, a more subtle form of [[BrainWashed brainwashing]] is used to turn them into a StepfordSmiler instead.
* Inverted, subverted, and played with - a lot: Bulgakov's ''The Master and Margarita''.
* In Terry Goodkind's ''Literature/SwordOfTruth'' series book ''Chainfire'', the protagonist awakes to find his wife gone, and everyone he knows convinced that she never existed and is just a character he made up during an injury. He then spends his time trying to convince people that she really exists. [[spoiler: It turns out to have been a plot by his enemies. Duh.]].
* In ''Literature/IAmTheCheese'' by Robert Cormier, [[spoiler:the protagonist goes on a mental journey around his prison/interrogation center to recreate a traumatic event from his childhood,]] although this confusion from reality is not known until the end.
* In Edmond Hamilton's ''Star Kings'' duology, the second book starts with the protagonist going to a psychiatrist '''willingly''' in order to cure his memories of the first book's events (which he isn't sure are true). The therapy goes quite well until he's transported into the future to continue his adventures. The doctor believes he had a relapse and ran away.
* In ''Literature/TheChroniclesOfNarnia'', [[spoiler:the Lady of the Green Kirtle tries to [[BrainWashed brainwash]] the heroes into thinking that Narnia was just a figment of their imagination, and that her underground caverns are the only "real" world. Puddleglum manages to stop her with a ShutUpHannibal.]]
* Similarly to the ''Narnia'' example above, in the third ''Literature/MaximumRide'' book, scientists try to convince Max that their escape was a dream, and that they were at the School the whole time. [[spoiler:It's not true.]]
[[/folder]]

[[folder:Live Action TV]]
* ''Series/BuffyTheVampireSlayer'' had a perfect example of this in "Normal Again". This episode ended leaving open the possibility that the entire series was in fact the hallucination of an insane Buffy Summers.
** Notably, instead of Buffy being encouraged to kill herself, she was encouraged to [[spoiler: kill all her friends]], and came very close to doing so. [[EasilyForgiven They got over it]] [[StatusQuoIsGod astonishingly quickly]], though. Stuff like that happens in Sunnydale.
** The description of the episode on the DVD case suggests that it was an alternate reality in which they really are hallucinations, but they're perfectly real in their reality. [[WordOfGod Word of Joss]], however, seems to suggest that he finds it perfectly acceptable if fans conclude that the entire series was the fevered dream of a schizophrenic Buffy.
* ''Series/{{Smallville}}'', episode "Labyrinth". The culprit was an evil phantom who was trying to break Clark Kent's will so he could take over his body.
* ''Series/StarTrekTheNextGeneration'', episode "Frame Of Mind". Commander Riker is taking part in a ship's play, in which he plays an innocent man thrown into a mental asylum (presumably for political reasons). At the same time he's being briefed on an undercover mission to a hostile planet. Riker starts to experience dreams and hallucinations in which he's trapped in the mental asylum. At one stage he's rescued from the asylum by the Enterprise crew who inform him he was captured during his mission. It turns out though he's still back in the asylum -- Riker ''was'' captured on the mission and his memories of the play is how his mind is coping with the aliens' attempts to MindProbe him. Once Riker realises this he's able to "break down the walls" of his fake reality, get his hands on a communicator and beam out of there. The episode ends with him trashing the set of the play, just to make sure.
* ''Series/StarTrekDeepSpaceNine'', episode "Shadows and Symbols". Interestingly, the 1950s Sci-Fi writer that Sisko plays in the alternate reality was used earlier in the series ("Far Beyond the Stars"), only now he is completely insane, writing his dreams of Deep Space 9 on the walls of his cell.
** They considered ending the series with the sci-fi writer on a set, carrying a script for Series/StarTrekDeepSpaceNine, but apparently decided that Trekkies would hate seeing their beloved series framed as fiction.
* Combined with a holodeck malfunction in ''Series/StarTrekVoyager'''s "Projections". It's given the twist that the character it happens to is a hologram who is being made to believe that he is the only person who is actually real.
* The final episodes of ''Series/FirstWave'' did this.
** Very effectively too, considering the whole alien plot of the first wave of invasion was to drive a few people insane as a test, and protagonist Cade grows increasingly unhinged over the course of the series.
* ''Series/StargateSG1'', episode "The Changeling".
** Played with in that ''neither'' reality is real. [[spoiler:Except for Daniel.]]
** The Season 2 finale is a variation on this. The team is never made to think that they are in mental institutions, but that they are in ''the future'' and everyone they knew is long-dead.
* ''Series/StargateAtlantis'', episode "The Real World": Weir wakes up in a mental hospital and is being told she just recovered from coma caused by an accident. Apparently, she only imagined the Stargate program. [[spoiler:In truth, she's infected with Replicator nanites who are trying to take over her mind and body. With some external assistance in the form of Rodney figuring out what's going on and [=EMPing=] her body to disrupt the nanites, she fights them off.]] The episode ends with an off-handed comment by Sheppard that they might still not be in the "true" reality, which is quickly silenced by Weir.
* The ''Series/{{Medium}}'' episode "Time Out of Mind" started off with this plot.
* The ''Series/{{Lost}}'' episode "Dave" has elements of this; it was actually written to debunk the common fan theory that everything was in someone's head.
** Like the Buffy example above, "Dave" ended by humorously suggesting that everything ''was'' in Hurley's head: we see him back in the asylum, with his new supposed girlfriend Libby revealed as another inmate. Libby's backstory was originally intended to intertwine with Hurley's, but the character was killed off before they bothered to film the episode. She was going to be his creepy stalker, set to juxtapose Hurley's own creepy stalker tendencies in the alternate reality of the final season.
* The ''Series/RedDwarf'' episode "Back to Reality" involves the crew waking up and finding out that all of their adventures aboard Red Dwarf have been a total immersion video game that they've been playing... very, very badly. As this was the fifth series finale, it was entirely plausible to viewers at the time that this was how the series was going to end. In somewhat of a twist, rather than being merely a more "normal" version of the reality, each character was the polar opposite of his normal character.
** The ''Series/RedDwarf'' comic ran a strip where the episode ended differently, and focused on the Cat's supernerd alter ego Dwayne Dibbley. At the end, Dwayne decided that he was the real person and The Cat was just a hallucination.
** The comic ''loved'' that reality; there was also a Jake Bullet strip that eventually crossed over with Duane Dibbley, and a strip about the "better" players there's a brief glimpse of before our Dwarfers left the TIG building.
* The ''Series/{{Supernatural}}'' episode "Sam, Interrupted" had former hunter/family friend call Sam and Dean for help from inside a mental institution, which prompts the brothers to get themselves admitted as patients to check out his claims of supernatural phenomena. When their incarceration pushes them both to the breaking point their personal issues send them over the edge. The thing they're there to hunt doses them with crazy juice and they both have psychotic breaks while the audience watches, deeply confused. Dean's psychiatrist may have been a hallucination, which is too bad, because he actually talked to her some.
* The ''Series/{{Charmed}}'' episode "Brain Drain" has Piper being manipulated into believing that she's a mental patient instead of a witch, and she has to renounce her powers to regain her health.
* First season finale of ''JoanOfArcadia'': Joan is for a time convinced she was hallucinating the God avatars, and the second season premiere has God coaxing her back into accepting His presence.
* Used to rather creepy effect in ''Series/{{Neverwhere}}'' and in the book of the same name it spawned. Richard, partway through his bizarre adventure in the sewers and other places, had his 'spirit tested', by essentially weaponizing this trope.
** The story has elements of this sprinkled throughout, as well.
* The premise of ''Series/{{Life On Mars|2006}}'' (UK version), particularly during the second season.
** And the SpiritualSuccessor ''AshesToAshes'', with the protagonist realizing it early on.
* ''Series/TwilightZone 2002'' episode "Another Life" had the main character oscillating between a reality where he is a happily married and successful musician and another where he is a suspect being violently interrogated by police. During all the episode [[spoiler:you're guided to believe that he actually is a cop that dreams he's a criminal]], and then comes the obligatory TwistEnding.
* Somewhat subverted in ''Series/StElsewhere''. The series finale reveals that the entire show was just in the mind of little Tommy holding a snow globe, who was either autistic or catatonic. A subversion because it all really ''was'' in the mind of someone with mental problems, and stayed that way forever.
* In a similar case, the soap ''Series/{{Crossroads}}'' returned a long time after being cancelled, and ended with the entire series revealed as a fantasy by an autistic woman who worked in a supermarket.
* On ''Series/{{Farscape}}'', the Scarrans actually consider this a valid [[ColdBloodedTorture interrogation technique]]. Crichton only beat it because [[spoiler:[[NotSoImaginaryFriend an artificially intelligent hallucination]] helped him counter it.]]
** This was exceptional surreal as all the non-humans John had met appeared...as non-humans. And everyone on Earth was perfectly okay with Luxans and Delvians running around.
* ''Series/TheSarahConnorChronicles'' plays this perfectly straight when Sarah's disturbing dreams of being kidnapped and tortured send her to a sleep clinic, with scenes shifting between Sarah's stay in the clinic and her frightening dreams. [[spoiler: As she begins to gain control in her "dreams" and the world of the clinic [[ThroughTheEyesOfMadness spirals into paranoia and horror]], viewers may come to suspect the presence of the trope, at which the show hints from the very beginning by starting the episode in the "dream".]]
* Done in ''Series/LegendOfTheSeeker'' where the title character is led to believe that the entire series has been a hallucination during an illness.
* ''Series/{{House}}'':
** This is a recurring theme in the 5th Season. The episodes leading up to the season finale suggest to the viewer that Greg has earned a [[HappilyEverAfter happy ending]], but [[spoiler:you soon learn that the [[DownerEnding reverse is actually true]].]]
** Also played with in the season 2 finale, in which House was forced to determine what was real and what wasn't after [[spoiler: he was shot by an unknown man, which was somehow causing him to hallucinate during his recovery from the injury]]. He eventually figured out that [[spoiler: everything that occurred from the moment he was shot up until then had been a hallucination]], which allowed him to [[spoiler: wake up and discover that only a few minutes had passed since the shooting, and he was still being rushed down to the ER]]. Kind of a combination of this trope as well as [[spoiler: AllJustADream ]].
* ''Series/{{JAG}}'': In first season episode "The Prisoner", when Harm is taken to a Chinese military prison he begins to [[HearingVoices talk with, what appears to be, another prisoner in another cell]] who turns out to be his [[MissingRelative father]]. However, on the surveillance cameras it shows that Harm is talking to no one, and the Chinese later explain that it’s all due to the drugs they’ve administered.
* The ''Series/SevenDays'' episode "Déjà Vu All Over Again" has Frank Parker growing more and more UnstuckInTime, and his grip on reality growing more and more tenuous, but he manages to take control of his new powers and use them to save the day [[spoiler:until the ending suggests that he might still be in the mental institution he was plucked from in the pilot episode, with the series only happening in his head]].
* The ''Series/BeingErica'' episode "Erica, Interrupted" has Erica wake up in the hospital she went to in the series premiere, where she's told that the events of the past three seasons took place in a two-week coma caused by anaphylactic shock incurred during the pilot. She tells [[spoiler:the image of]] her [[spoiler:dead]] brother that whether the events really occurred or not is irrelevant; she's grown from them. [[spoiler:It turns out that the events were a final test before Erica 'passed' group therapy and became Dr. Erica.]]
* In ''Series/{{Community}}'', Dr. Heidi tries to convince the study group that their past three years at Greendale Community College were all a shared delusion, taking place at the Greendale Mental Institution. Considering that everyone ended up at Greendale for life-shattering reasons and a previous episode stated that everyone but Abed had psychotic tendencies, this was depressingly realistic... [[spoiler: until the group realized there was a flaw in Heidi's logic. A) Shirley's kids and husband, who she sees every day. B) Abed has pictures of Greendale on his phone. C) Annie is wearing a Greendale backpack the whole time. Heidi quickly admits to being a fraud hired by the psychotic Chang, who has taken over the school and replaced the dean, in order to keep the group from uncovering his actions.]]
* In the ''Series/{{Warehouse 13}}'' episode "Don't Hate the Player", when Beatrix Potter's tea set brings the agents' worst fears to life, the worst fear of Claudia, who previously spent some time in mental institution, is that she is still in that mental institution receiving electroshock therapy, and that her life in the Warehouse is all a lie.
* An episode of ''Series/DoctorWho'' had the Doctor, Amy, and Rory alternating between Amy and Rory's home village and the [=TARDIS=] trapped by a star that somehow produces antiheat, being told by a mysterious entity that they can escape if they can work out which universe is the real one. [[spoiler: The kicker is that ''both'' universes are hallucinations and they and the mysterious entity are the result of psychically active pollen that got into the time rotor.]]
[[/folder]]

[[folder:Music]]
* The music video to "''Asylum''" by Music/{{Disturbed}} has the patient/protagonist [[ThroughTheEyesOfMadness going through a series of events while escaping from the asylum that most likely aren't happening]]. These include being beaten and killed multiple times by the doctors and staff, and later [[ForceFeeding force-fed]] his own (apparent) body parts (camera tricks are used to differentiate between his delusions and reality). Each of these events after his death lead to a ResetButton in which he's back in his padded cell, and by the final event he's [[GenreSavvy gotten wise]] to this, and tries to kill himself in a furnace. [[spoiler: Except this time it was real]].
[[/folder]]

[[folder:Radio]]
* The AudioPlay/BigFinishDoctorWho audio drama ''[[Recap/BigFinishDoctorWho019MinuetInHell Minuet in Hell]]''.
[[/folder]]

[[folder:Tabletop Games]]
* Before the {{Ravenloft}} setting was a game-world, it was a 1st Edition D&D module and its sequel, which feature the same villain but take place in completely different regions. One way it was suggested [=DMs=] might integrate them was to use either or both of them as a Cuckoo Nest, such that the [=PCs=] would periodically collapse with BrainFever in one module and "wake up" in the other.
* There has been a scenario for ''TabletopGame/WerewolfTheApocalypse'' that worked like this, with a lot of shoutouts to ''One Flew Over The Cuckoo's Nest''. The players are being "cured" of thinking they are werewolves. In reality, they are stuffed with rage/gnosis suppressing drugs and the plan of their captors is to repeatedly abuse them until they are ready to be transformed into fomori. The scenario ends with a mindscrew and [[spoiler: it is quite possible the whole game session is a hallucination caused by a previous week's villain.]]
[[/folder]]

[[folder:Theater]]
* Calderón's ''Life is a dream''
[[/folder]]

[[folder:Toys]]
* Subverted in ''{{Bionicle}}''. Sahmad is placed into a LotusEaterMachine in which he is being accepted into the new society on Spherus Magna. Since the first person he meets is being nice to him, as opposed to running away or attacking him, he assumes that she's insane and that he's trapped in some sort of asylum.
[[/folder]]

[[folder:Video Games]]
* ''AmericanMcGeesAlice'' does a similar thing with ''Literature/AliceInWonderland''; in this case the entire game is based on the presupposition that the original books were mental aberrations, with the different characters representing various personality fragments and psychoses.
** You wouldn't really know this if you hadn't [[AllThereInTheManual read the game's manual]], though, which provides the detailed journal of the psychiatrist who spent years treating Alice for her psychoses and makes frequent mentions of her ramblings and drawings, all of which somehow relate to the events of Wonderland.
** A bit different from most examples since, canonically, Wonderland was AllJustADream anyway.
*** So was Through The Looking Glass. The question is: Whose dream was it?
** It's subverted in ''AliceMadnessReturns'', where Alice is completely aware that her excursions to Wonderland are delusions. That doesn't make what she does there [[BattleInTheCenterOfTheMind any less important.]]
* ''VideoGame/BatmanArkhamAsylum'': Scarecrow does this to Franchise/{{Batman}} and [[InterfaceScrew the player]] in his first appearance.
* ''MaxPayne2'' had a ShowWithinAShow, ''Address Unknown'', where the protagonist was in an insane asylum and thought everyone ''else'' there was insane.
** The show's events also parallel Max's own experiences to a disturbing degree, one of the many hints during the game that Max is not entirely sane. Max even [[LampshadeHanging lampshades]] this at one point.
--> '''Max:''' When entertainment turns into a surreal reflection of your life, you're a lucky man if you can laugh at the joke. Luck and I weren't on speaking terms.
* The entire premise of ''VideoGame/{{Sanitarium}}'', if we discard the resolution.
* Played arrow-straight in ''AlanWake'', where the protagonist awakens at an insane asylum and is told he has hallucinated everything prior. The protagonist does not believe a word of it. [[spoiler: And he is right.]]
** Later in the DLC chapters, [[spoiler:as he has been split in two personalities, the insane and suicidal part of him tries in a desperate bid to stop the rational and determined part in his attempt to do a SplitPersonalityMerge by suggesting this idea to him once again. It still doesn't work]].
* In the fourth episode of the ''CityOfHeroes'' "Who Will Die" story arc, Malaise tries this on Sister Psyche and the PlayerCharacter.
** That's the hero version of things, at least - villainous characters are instead helping Malaise to do it to Sister Psyche, down to getting a character as a psychologist in the hallucination and 'explaining' why she chose particular elements.
* In ''VideoGame/TheDarkness II'', several segments take place in an asylum where [[AndYouWereThere various characters show up in different roles]] (including the BigBad as a doctor and your girlfriend as an orderly). In this case, you're outright told by a sympathetic party that the asylum is just a construct the Darkness is using to keep you from going to Hell to save your dead girlfriend. Late in the game, you're given the choice to stay in the asylum, or jump to your "death"; the latter leads to the final sequence of the game.
** In an interesting and amusing twist, you can find ''ComicBook/TheDarkness'' comic books [[RecursiveCanon in your room]], implying that you made the whole thing up after reading the comic.
[[/folder]]

[[folder:Webcomics]]
* A storyline in ''Webcomic/{{Fans}}'' sees the [[GovernmentConspiracy F.I.B]] kidnap Shanna Cochran and - reasoning that, as the supposedly least imaginative and most 'mundane' member of the Science Fiction Club, her mind would crack under too much pressure - attempt to convince her that she is imprisoned in a mental hospital and merely hallucinating her admittedly far-fetched adventures in order to get her to turn on her friends, or at least reveal important information about them. Unfortunately for the F.I.B, however, this backfires quite spectacularly; convincing Shanna that she's crazy merely serves to [[TheUnfettered break the self-imposed restraint]] on her imagination that she adopted after her own mother really went crazy, meaning that the now 'crazy', yet [[CrazyAwesome fiercely imaginative and inventive]], Shanna finds it remarkably easy to outwit her captors, escape, and play a not-insignificant role in thwarting their latest plan.
-->''"The pain clears my head.. and reminds me of something I heard one time... It's impossible to get out of a straitjacket, because it uses the way your bones lock together. Of course, some people have escaped by dislocating their own shoulders... But to mutilate yourself, just to escape a straitjacket? While you're still in a locked cell in a holding facility? Why, to do '''THAT''', you'd have to be...stark...raving..."''
* [[http://www.sinfest.net/archive_page.php?comicID=2133 Invoked/parodied]] in ''Webcomic/{{Sinfest}}''.
[[/folder]]

[[folder:Web Original]]
* ''AHDotComTheSeries'', two-part episode "The Gates of Dawn".
* Done extremely well [[CoolVersusAwesome with the trailer for]] ''[[http://www.youtube.com/user/themanbatman#p/u/4/WnZRU8RahTY The]] [[http://www.youtube.com/user/themanbatman#p/u/3/6RppxhOdby4 Batman]] [[http://www.youtube.com/user/themanbatman#p/u/1/8pIV4AgHcoc Complex]]'', [[FanVid a fake film]] where the Creator/ChristianBale Franchise/{{Batman}} [[Film/TheDarkKnightSaga movies]] are revealed to be a hallucination by Christian Bale's character from TheMachinist, who is being treated for schizophrenia by [[LeonardoDiCaprio Cobb]] and [[{{Joseph Gordon-Levitt}} his]] [[EllenPage team]] [[TomHardy from]] {{Inception}}.
* On the ''Wiki/SCPFoundation'', in one of the realities visited by [[http://www.scp-wiki.net/scp-507 SCP-507]], an involuntary inter-dimensional traveler, he was kept in a mental hospital for the duration of his shift when they mistook him for an inmate suffering from dementia.
[[/folder]]

[[folder:Western Animation]]
* ''WesternAnimation/EdEddNEddy'' has the fourth (and [[UnCancelled originally last]]) season finale reveal that everything shown was just three old men reminiscing about their childhood. That would at least explain how nothing took place out of their cul-de-sac, the lack of a definite time-frame, and [[MinimalistCast how nobody but the main cast are ever mentioned]] or shown even when they are at school.
* In ''WesternAnimation/AllDogsGoToHeaven'', the filmmakers seem to hint that Charlie's first visit to heaven after after his NearDeathExperience [[WildMassGuessing might have just been a hallucination,]] that it's just a coincidence [[DeathsHourglass the watch that represents his life on Earth]] resembles the one Carface gave him, and that at the end, [[spoiler: rather than dying because the watch got flooded and stopped working, Charlie might have drowned instead]]. Observant audience members are kept guessing 'til the end, when [[spoiler: Charlie's ghost visits Anna-Marie one last time before passing on.]]
[[/folder]]

[[folder:Other]]
* This is the premise behind the roleplaying meta-game Power Kill, which is played in conjunction with a regular RPG with the events of that other game treated as the hallucinations of the Power Kill characters.
[[/folder]]

----