Nelly Bly was an investigative reporter who was committed to an asylum by a judge, more at linked page. In the US, for decades, jails hold many more mentally ill people than psychiatric facilities do.
https://en.m.wikipedia.org/wiki/Ten_Days_in_a_Mad-House