So you risk getting into "revolving door" admissions to hospital. A person with a psychosis becomes ill, rejects medication, is detained against their will in hospital and given medication against their will (sometimes by force) until they "become well" enough to be let out of hospital. At which point they're free to decide to stop taking the medication.
I'm not sure that this style of revolving door admission is better for the person than just letting them be homeless. (Although preventing people getting into that situation would be a good idea).