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).