Loose rivits:
When the brain plays up - the most complex organ in the body, by many orders of magnitude - it causes bizarre symptoms, and great distress to the sufferer and to those around him/her. It just has to be coped with by the hopefully, competent crew. Job done - at least for those not burdened in the long term.
What we don't know but will in the future is whether he had prior knowledge of his mental condition and had not reported it on his 6-month FAA medical.