The "state hospital" in my area was shut down in the eighties. It turns out that many of their treatments were ineffective and inhumane. I believe there is still a support group for former patients that is active.
I don't know how much truth there is to it, but people I've known that worked in metal health institutions have complained that they're systemically being shut down with no where for the patients to go. They say that often patients end up being handled by police, EMTs, and medical workers. None of which are particularly expert in dealing with mental health issues.
I think that is true, this is a population that has been historically under-served. In my opinion, lack of funding was at least part of the problem with these institutions; one common thread seems to be a lack of staff.
That happened in the US a long time ago, starting in the 1960s.[1] "By 2000, the number of state psychiatric hospital beds per 100,000 people was 22, down from 339 in 1955." During this period, prison populations went way up.