According to the British Crime Survey, almost half of the victims of violent crimes reported that their assailant was drunk at the time of the attack. 17% reported that their assailant was under the influence of illegal drugs.
Another survey reported that 30% of victims believe that they were attacked because their attacker was under the influence of drink or drugs. Only 1% believed that they were attacked because the offender had a mental illness.
If you just look at homicide figures then 10% of people convicted of homicide between 1996 and 2005 were known to have mental health problems at the time of the offense.
My point is that there's a far bigger public perception of people with mental health issues being a danger to others than is the reality. Drink, whilst completely legal, is a far bigger problem in violent crime (no surprise there really) - although it had to be said that substance abuse can also lead to mental health problems.
In general, people with mental health issues are actually far more likely to be victims than perpetrators of crime.
So, should they be locked up? If they're considered, with reasonable grounds, to be a danger to themselves or others then perhaps, yes. Just because they're suffering from schizophrenia on the off-chance that they may become a danger? No, I don't think so. Not unless you're also going to start locking up everyone who likes a drink on a Friday night too.
Is it a problem that people forget to take medication or decide that they don't need it on a particular day? Yeah. Is locking them up the solution? I wouldn't have thought so.