5150 does not mean "crazy person", literally speaking. It is the section of the penal code in CA. that allows police to detain someone against their will for a 72 hour evaluation in a psychiatric hospital. (Locked ward). It is commonly used for people who might be a danger to themselves or others, such as attempted suicides, etc..
So it's an easy jump to use it as slang for "crazy person", but just remember: no one in the world ever got locked up for being crazy. Only for acting crazy. We have some fine examples around here of people who are crazier than a *****house rat and still freely roam the earth, sometimes even driving Porsches. Or Mitsubishis.