Magical Schizophrenia (3.5e Flaw)
From D&D Wiki
Arcane energy has changed you, you fear its powers and your train of thought is also affected.
Prerequisite: Ability to cast arcane spells.
Effect: Whenever you cast a spell, you must make make a Will save against a DC of 6 + twice the level of the spell you were trying to cast. If you fail the check, your alignment shifts to a random alignment until you cast a spell and make your Will save. Your character must act out the new alignment appropriately.