It sounds like you have little insight into why your family and the medical team thought you were a danger to yourself and others. Section 5150 of the California Code enables institutions in that State to hold you involuntarily. Whether medical records are public (which I doubt) and if so how to expunge them, is a question that should be directed to a mental health lawyer in that State. Your inquiry shows a Farmington NM location.
Sign up to receive a 10-part series of useful information and legal advice about the divorce process.