Green’s Dictionary of Slang

5150 n.

[police code, an insane person is annoying the public]

(US black/prison) someone in need of mental health treatment; an eccentric, a crazy person.

[US]Other Side of the Wall: Prisoner’s Dict. July 🌐 5150: A person needing mental health treatment, based upon the California Welfare and Institutions Code section for civil commitment. Other states will use different numbers, such as ‘730’ in New York.
[US]P. Beatty Sellout (2016) 78: I should’ve hospitalized him right then and there. Called the police and had him 5150’d.