Repressive government's don't do their blocking at the browser level because it is completely ineffective. Anyone who wants to access the forbidden websites will be able to do so anyway.
What could work is a local proxy server that translates the host name in the request.
It must MITM the https requests though.
Only if you configured it that way. Most http servers have a "default" website which they will happly serve from if the Host header has no match. I expect these sites will continue to work just fine in firefox using the host file hack or via alternative DNS domains.
Unless they just want a foot-in-the-door law to make certain browsers illegal (to then expand on it later), blocking content at the terminal is not the way to do it. So so many ways to get around it.
The French government censors websites by forcing ISPs to delist stuff from their DNS servers. It's trivial to bypass simply by setting alternative DNS providers like Cloudflare.
Why would this ever be done on a browser level? Any nation with internet censoring intentions can already do this by blocking it on an ISP level.
The governments cannot go and forbid browsers to do that if they don't have the law to back it.
Because government says so. Its signaling/actionism for political/power purposes.