Many countries which grant freedom of movement and related rights to their citizens have laws which allow these rights to be suspended during extenuating circumstances such as a pandemic, war, or other disaster. Some governments, such as Romania's, have fallen foul of the courts by failing to implement such exceptions - in this case, a law is currently being debated in Parliament.
Another example of this came right at the beginning of the COVID pandemic in the UK, where the Government swiftly put in place a statutory instrument, The Health Protection (Coronavirus) Regulations 2020, Regulation 4 of which gives the Secretary of State for Health the power to detain individuals. Reporting at the time drew a link between this SI and one of the then eight confirmed people in the UK with the virus threatening to abscond from a quarantine centre the night before, at which time the Government had no power to stop them.
As far as I'm aware, the only real current example of a restriction on the ability of a government to force patients who have tested positive to remain either in a hospital or quarantine center is in South Africa, where the High Court in Pretoria granted an application made by AfriForum which declared the regulations on this invalid. This ruling was then made an order of court by consent of the Minister of Cooperative Governance and Traditional Affairs Nkosazana Dlamini-Zuma, according to AfriForum.
The ruling states:
It is ordered that:
- Regulations 6 and 7 published by the Respondent on 29 April 2020, in terms of section 27(2) of the Disaster Management Act are to be
interpreted and applied as follows:
- 1.1. A person who has been confirmed as a clinical case or as a laboratory confirmed case as having contracted Covid-19, or who is
suspected of having contracted Covid-19, or who has been in contact
with a person who is a carrier of Covid-19; is only required to be
quarantined or isolated at a state facility, or other designated
quarantine site; when that person is unable to self-quarantine or
self-isolate, or refuses to do so, or violates the self-quarantine or
self-isolation rules.
- 1.2. To successfully self-quarantine or self-isolate, a person requires access to a separate room where the person should
self-isolate (no-one else must sleep or spend time in the room). The
person must also be able to contact and /or return to a health
facility if their condition worsens.
- There shall be no order as to costs.
This means that the government can only force someone to remain in a hospital or state quarantine facility if they can prove that the person does not have access to a self-isolation room, refuses to self-isolate, or otherwise breaks the self-isolation rules.