I believe vaccination and infection are not the same. You have a point in that it's beneficial to instigate a response when it's least risky.
But infections don't wait for the beneficial timing. For example, infants younger than 6 months are at high risk of severe or fatal RSV. If infants avoided RSV at the cost of later childhood infection, then the post-lockdown rebound of infections may have indirectly reduced the infants' risks.
It's also risky to achieve population immunity through infections. Prior influenza pandemics, for instance, took numerous lives before herd immunity was achieved.