Illegal, no, but a massive overreaction. This is why the Swedish model (of telling people to take reasonable steps like not getting too close, and staying home when sick, and away from old people) is proving so successful. They've even started to see a flattening of the curve alongside the rest of the world without lockdowns. [1, 2]
[1] https://fee.org/articles/sweden-s-top-epidemiologist-covid-1...
[2] https://aatishb.com/covidtrends/?location=Canada&location=Sw...