It would fail.
For one thing, the detainees are not under arrest.
You only get arrested for offences. Being sick isn't one.
For another, the legislation provides for detention.
Finally, the public interest argument in favour of detention would prevail.