Yeah, okay, but sue the goverment to shit, then. Or whoever runs the medical institution in question not providing adequate service. The people responsible not having the resources or the political will doesn't remove the rights of a patient. If I have a mentally ill relative that needs to be committed and they end up in jail for weeks I'd be pissed and extremely litigious even before they end up mysteriously dead.
And also, does "pending evaluation" suspend habeas corpus if there is no evaluation in place to deem them a risk? WTF? What's to keep a hostile actor from maliciously putting a person in this track instead of properly charging them if they're just trying to dump them in a hole for two weeks? How does that hold to any constitutional scrutiny in the US? Surely you're either deemed incompetent and you are involuntarily committed until you're not... or you have habeas corpus. The hell is this limbo in between?
I know even here there is a lot of grey areas in this subject and some shaky legal foundations to safety measures for people who can't look after themselves, but... yeah, this seems messed up. More messed up than the baseline level of messed up around this thing.