In many of the sources which Gary Gygax listed in his Appendix N of the Advanced Game's Dungeon Masters Guide, magic/sorcery is a dangerous practice often dealing with sinister forces posing threats to one's sanity and mankind in general. This is reflected in certain game "magics" starting with the game's original edition.
Volume 1 of the three little brown books lists a spell called Contact Higher Plane. Its use may cause insanity. Its use may reveal dark secrets which threaten mankind's existence. From its inception, the world's first role-playing game has included the concept of planer dimensions - planes of existence which are normally beyond human perception, but can be reached using powerful magics. These planes have included everything from hell to various elemental environments.
The spell Contact Higher Plane establishes communication with an entity from such alternative plane, a deity, demon, or other supernatural being, who may divulge certain information to the caster in the form of answers to specific questions. The risks involved include false information as these beings may be deceivers, and insanity. I suppose the idea being that contact with such knowledge may unsettle the mind of the caster.
In the original edition of the world's first role-playing game Contact Higher Plane is a potent spell. It is ranked as among the spells of the fifth level and therefore only available to Magic Users of considerable experience - namely those who have reached 9th level or above in their class. In terms of the game this represents many sessions of play to reach such lofty levels. Magic Users of 9th level carry the title of Sorcerer, and may command such additional powerful magics as Polymorph Self (and Others), Dimension Door, Invisibility, Fly, as well as such destructive magics as the dreaded Fireball and Lightning Bolt (in addition to many lessor magics).
The resulting "Insanity" can be role-played as permanent, or temporary, as debilitating or as a mildly amusing personality quirk, all depending on the preferences of the referee and player. Depending upon how the referee rules on it, such "Insanity" may be cured using Cure Disease, Remove Curse, or Wish magic.