Sounds like poor decision making by the police.
Sounds like a way to get him help for his mental condition and to keep him off the streets, where he creates havoc for other pedestrians and for drivers. The ACLU won’t let him and others similarly afflicted be locked up in mental institutions due to their mental/emotional condition only, but if he’s convicted of a crime, he can be given the treatment he needs.