That's reprehensible. It's no wonder being institutionalized and interacting with law enforcement are both independent risk factors for suicide. Just after my mother died, I made the mistake of telling a friend who was a psychiatrist that I wanted to end my life. She called the authorities on me. They broke into my home, roughly rifled through my drawers, then forced me to a hospital in an ambulance with the whole neighborhood watching in disgust. At the hospital, they posted an officer to guard over me. He sneered at me the whole time and ridiculed me for being a coward. The doctors admonished me, telling me they had better things to do... The entire experience was among the most dehumanizing of my entire life and I've never opened up in any way anyone could commit me again.
The entire approach to "mental health" in the US, at least, is backwards. Which is part of the reason we're sitting at a 30-year high in per capita suicide rates in the US (and abroad). If we really wanted to bring suicide rates down, we'd treat each other much better so that more of us wanted to stick around.
Sorry for what you went through.