There was never any scientific basis for that belief. It was just made up without conducting experiments. And if fact we saw that some countries like Sweden kept primary schools open throughout the pandemic (without mask mandates) and it was fine.
And COVID and the Spanish Flu essentially targeted opposite populations, the former being dangerous to those with compromised immune function while the latter turned strong immune systems against the body in a “cytokine storm”.