I think you have a much broader definiton of "science" than I do.
Science requires carefull consideration, data, incorporation of peer review, statistics and probablities. The ultimate decision can still be off as science is dynamic, we learn new things all the time.
What you are describing is people who ran with something that was not supported by good science. People with an agenda, or people looking to sell something--often rely on research or claims that do not have broad reviewed support from folks in respective fields.
You are also making the same mistake anti vaxxers make--that if something is perfect and 100 percent accurate, it can't be relied upon at all.
To address just one of your points, I didn't see infectious disease experts saying masks worked to keep you from getting covid--what they were saying was that wearing them helps contain the virus you might be carrying more than not wearing one at all, especially before vaccines were broadly available.
Not perfect--but better than nothing.
They were also saying cheap masks aren't much better than nothing right off the bat, get an N95 mask (which were scarce early on due to slow federal recognition of need under the Trump administration--other countries had a supply faster than we did, even domestic manufacturers had contracts of them overseas before the US finally realized the need). Policy folks--not scientists--took that message a bit too far.
But don't take my word for it, check out this:
This study examines the dynamic impact of face mask use on both infected cases and fatalities at a global scale by using a rich set of panel data econometrics. An increase of 100% of the proportion of people declaring wearing a mask (multiply by two) over the studied period lead to a reduction...
www.nature.com
Note what they say about a country that had high mask adoption and how their rates of Covid were MUCH less than countries that did not within weeks of initial exposure. And thats while saying their works suggests less than 50 percent effectiveness!
Are they perfect? No, far from it. But again, people that think 100 percent effective is the only measure of worth is why we have so many problems, and that IMO stems from their basic lack of understanding of science.