Mostly, yes. Having been homeless myself for an extended period, I saw just how much mental illnesses impact so many people experiencing homelessness.
In my completely unscientific lodgings with them, I'd say its probably around 30% of the people have some sort of debilitating mental illness. I had other reasons for homelessness (lost job, eviction) which are much more mechanical and easier to fix.
I've talked with my SO about the mentally ill on the streets, and the only plan that seems to might work is to forcefully treat them, get them mentally sound, explain their whole situation, and have them choose. It would be in writing, and sealed with a palmscan. And I get that forcefully treating them once may be considered abhorrent, but they are not able in their state of mind to make decisions for themselves.
Once they're of sound mind, they should then have complete agency to choose to remain on the streets, or to obtain emergency services to get out of homelessness.