However, you still wouldn't fully eliminate infections because some people would not beat their infection in that time. They might sustain an infection for longer because of their own health, e.g. they could have an immune disorder or be on immunosuppresant meds.
Of course you can't actually do that because (1) the whole world's human population is incapable of coordinated action on this scale, (2) there would be lots of very valid exceptions -- e.g. are you going to split up a family with 10 kids or kick very ill people out of hospitals?, and (3) lots of people would try to cheat and many of them would succeed.
Basically we should be aiming for maximal vaccination, good treatments, constant monitoring, and good non-pharmaceutical interventions (e.g. ventilation, masks in crowded places). Lockdown-type measures should be used when there is the possibility that critical healthcare infrastructure could fail under excessive load, i.e. things like childbirth and broken legs could become dramatically more deadly.