Could also be like climate change, where it correctly describes a broad phenomenon, but cannot be used to identify or classify any individual event. E.g., Wildfires are probably getting worse because of climate change, but it's difficult to say if the Pacific Palisades fire would not have happened in a cooler global climate.
So, is microbiome-mediated social anxiety selected for as an advantageous trait for societies subject to communicable diseases and the travails of nomadism? Maybe. Did YOUR microbiome-mediated social anxiety arise because it was advantageous for your community? Probably impossible to say.
Also, a hole in GP's logic: you would expect protective social anxiety to arise in people whose situation hasn't much changed except that they've encountered people whose has (as with sedentary villagers encountering nomads who may or may not be about to ransack their settlement).