Futurama: Bender's Game

Ignoring Professor Farnsworth's orders to conserve fuel due to a rise in dark matter prices, Leela borrows the Planet Express ship to enter a demolition derby after being insulted by rednecks. They win it, however the ship is wrecked, but due to botched laser eye surgery, the Professor only notices that the fuel has been used. As punishment, Leela is fitted with a shock collar to teach her anger management. Meanwhile, Bender finds Cubert and Dwight playing Dungeons &amp; Dragons with their friends, but he cannot join in since, as a robot, he has no imagination. After several tries at imagining things, Bender manages to imagine himself as a medieval knight named "Titanius Anglesmith, fancy man of Cornwood" and enters the game. Unfortunately, he soon gets lost in his fantasy and goes on a rampage, resulting in his commitment to the Hal Institute for Criminally Insane Robots.
The crew learns that Mom, who controls the world's only Dark Matter mine, is restricting the supply in order to drive up profits. The Professor reveals to the crew that while working for her many years ago, he stumbled on a way to turn dark matter from a useless curiosity into starship fuel. The process created two energy crystals, with Mom keeping one for herself and Farnsworth hiding the other, "anti-backwards" crystal. If the two crystals are brought together, they will render all dark matter useless. Farnsworth has forgotten where he hid his crystal, but it is being used as a 12-sided die in the kids' D&amp;D game. Mom determines its location and sends her sons Walt, Larry and Igner to retrieve it, by saying that they are owl exterminators, but Farnsworth foils their attempt by sending an angry owl at them, messing up their plan since they do not know how to exterminate owls. Farnsworth, Fry, and Leela fly to Mom's mine with the crystal in order to neutralize the dark matter.
Reaching Mom's mine, the trio discovers the heart of the operation: thousands of captive Nibblonians, including Nibbler, being force fed chickens in order to collect their excreted dark matter. Igner spots them, having earlier overheard Mom telling his brothers a secret about him, and helps them reach Mom's office. Farnsworth tries to bring his and Mom's crystals together, but swallows his in order to keep it out of Mom's hands.
In the robot asylum, Bender is diagnosed with insanity and is due for a "Robotomy" in order to remove his imagination processor. The closeness of the two dark matter crystals triggers a resonance in all dark matterâincluding a stockpile Bender has stored within his bodyâand catapults all the characters into Cornwood, the realm Bender imagines himself to be from. The other members of the Planet Express crew (Hermes, Zoidberg, and Amy) are transported as well.
"Frydo" (Fry) and "Leegola" (Leela, now a centaur) emerge first and encounter Titanius (Bender); no one in Cornwood has any memory of their real-world lives, except for Fry and Leela. The three are attacked by "Waltazar" (Walt), "Larius" (Larry) and "Ignus" (Igner), who are trying to recover the anti-backwards crystal. While fighting them off, Frydo drops the crystal, which rolls like a die and magically banishes the sons from the area to the Swamp Hag's swamp. Frydo and company meet the wizard "Greyfarn" (Farnsworth), who explains that in this world, the anti-backwards crystal is known as the Die of Power. The evil snake-haired sorceress "Momon" (Mom) molded a set of powerful dice, but lost this one and has been trying to locate it so she can tap its immense potential. The only way to stop Momon is to enter her lair at the Geysers of Gygax and throw the Die into the lake of molten plastic from which it was formed, destroying it.
As the group sets out, the intersex, pacifist centaur "Hermaphrodite" (Hermes) bars their passage, since the centaurs are opposed to the violence that Frydo and company intend to do. However, (s)he is easily pushed aside by Leela, who leads everyone to the Cave of Hopelessness. As they approach, "Gynecaladriel" (Amy): Queen of the Water Nymphos joins their quest and seduces the guard, enabling them to enter the Cave. Inside the Cave, a horde of "Morcs" (orcs) attacks followed by a gigantic lobster creature (Zoidberg) which Leegola brutally cuts to pieces in a rage, and the wormlike Tunneling Horror which Frydo defeats using the Die. As Frydo becomes obsessed with the Die, Leegola renounces violence after realizing Zoidberg was not the tunnelling horror, and flees to take refuge among the centaurs. That night, Frydo makes a botched attempt to murder the other members of the party; when foiled, he flees with the die.
The remaining travelers journey to Wipe Castle to raise an army against Momon, only to find that Roberto, its insane king, has already sent his men on a pointless suicide mission. The heroes defend the kingdom alone as Waltazar and Larius lay siege to it, until Leegola regains her violent nature and rallies the centaurs to help her friends. Frydo makes his way into Momon's lair, aided by Zoidberg's still-living head; Frydo cannot bring himself to destroy the Die, so Zoidberg bites him to force him to drop it. Momon becomes a dragon and goes after the Die, but when it stops rolling, it turns Frydo into a dragon as well. The rest of the party arrives, along with Ignus, who reveals a secret Momon told his brothers: he is Greyfarn's son. Overwhelmed by this revelation, Greyfarn falls on the Zoidberg creature (who had claimed the Die), allowing Momon to seize the Die.
Cornwood collapses in on itself, hurling the characters back into the real world. With the crystal back in the Professor's stomach, Mom once again orders Walt and Larry to retrieve it. Before his moment of discomfort, the Professor requests a hug from Igner. Mom complies, saying someone should hug him as she never has. As the Professor had theorized, Igner had swallowed Mom's crystal in defiance and the hug brings the crystals in the two men's stomachs close enough to render all dark matter useless, breaking Mom's stranglehold on the fuel supply. As a temporary propulsion source, the crew harnesses dozens of Nibblonians to pull their ship home, which they call "Nibbler Power".

Question: What was the cause of this diagnosis
Answer: Robotomy