I don't agree that it's not 'scientifically sound', it just depends on what signals the data actually shows. Natural experiments are never perfect and with something like isolation it's probably impossible to ever see such natural experiments without major confounders. I don't see why that makes you abandon the idea that anything can be learned at all.
I'm just saying that in this particular scenario there would be so many if's, what if's and buts that I think you would struggle to come up with a viable methodology, let alone a viable "conclusion".
"Lockdowns" are also inherently subjective, social and difficult to study in any sort of meaningful way. Not least because different governments implemented them differently, and different populations adhered to them differently. So you'll never really get a clean dataset - and that's assuming people tell you the truth anyway about how compliant they were with the rules.
I think a more reasonable perspective would be to wait until we know more about COVID and (especially) long-COVID. Once the world knows more about the cognitive effect of COVID, then would be the time for secondary analysis on lockdowns.
Afterall, it may well be that lockdowns were more preferable to getting infected with COVID in terms of cognitive decline. Or it may be that both "options" were more or less equal in terms of decline. But for all that we need more time to study COVID itself.
You seem to already have the assumption that covid is worse than isolation. I'm not sure if that's true. Would you want to bet that 5 years of isolation is better than a covid infection for cognitive function? I certainly wouldn't. Where I am, many people have been isolated for quite literally about 2 years (and many are choosing to isolate further despite the official rules mostly being relaxed). I don't think it's good enough to think of isolation as a secondary effect here.