Inquest reveals failings in mental health care