Boosting xp costs sanity, if a girl gets to 0 sanity she can't be the leader anymore and is forced into an ability that is usually something opposite of what she is normally good at. Also just participating in fights also costs a bit of sanity for a girl.leveling and boosting xp, changes the girls ability. Is that a bug?
You can recover sanity by buying a new ability for the girl (+10 sanity), or by letting them rest during a fight (don't assign them to fight any of the demons, +15 sanity). But you also need low sanity to unlock their solo route scenes, so up to you if you want to keep their sanity high, or lower it without letting it hit zero, or finding a way to just play with that girl at 0 sanity.