It would be precisely "losing your sanity".
LOSING SANITY Losing sane mind, thinking defectively at an important and irrational level. Stop being sane.