I'm not an expert and you should check these facts yourself, but my personal experience was that I investigated this after a trip to Japan many years before the pandemic began. I wondered why western culture did not have a similar mask wearing etiquette and my conclusion on the efficacy was that the evidence for it actually making a difference was sparse and weak.
EDIT: I may have misunderstood your emphasis. I took it to be on the time, as in you were saying that we knew beforehand that masks worked. I see this might not be correct. If you are saying that the evidence is still not good, you may be correct, but I think there is enough early evidence and plausible mechanism of action to assume that the right mask in the right setting is effective. I accept that single layer cloth masks might not do much.
So—in contrast to the vaccine, where the data was gathered before giving authorization was given last year—it seems that mask mandates may have been just hopeful trials that assumed there wasn’t long-term problems associated with masks, well in advance of actually having relevant data. And, in further comparison, we also have drugs like HCQ, which were pushed ahead of the data—and continue to be advocate despite continued lack of evidence in large trials. So it feels unclear that data ever mattered as much as being seen doing something? I’m saddened by it all.
Thankfully most evidence-respecting organizations including governments have taken the position that it is very unlikely that HCL is of any benefit as the data has become better. Its really only fringe groups who are pushing that one hard still and even many of those have moved on to ivermectin.