Not that I'm any sort of expert on the subject, but I believe Gates and his foundation have been pushing this observation for years now. We were unprepared but we should not have been.
You're right that we got a little lucky this time, in a way. The nightmare scenario would be a virus that is truly airborne and very deadly, and with a delayed onset like COVID. Anti-maskers would not trouble the rest of us for long in that case. Only immediate and drastic measures would work then, I think.
But I believe many far more knowledgeable than me would say the real lesson learned is about ensuring the healthcare resources are there for both the patients and workers. I think we'll have a much better handle on that part of the equation. If anything remotely similar to the nightmare scenario I described were to occur, we'd have no chance without making sure the people treating the patients were protected.