In family law cases, mental health can be a major factor, especially when it comes to the question of capacity and the ability to make wise decisions on one's own affairs.
However, it is not normally seen as disentitleling behaviour in a family court