Why assume it's the diets rather than antibiotics? Your gut microbiome develops during the first ~3y of life(including partial heritability from your mother), after which the total set of microbes in it remains approximately constant throughout your life, with only the relative proportions of them shifting with diet changes.
In contrast, antibiotics often kill a strain of a few off completely, while suppressing everything else except for a few strains that resist the antibiotic, which also creates a massive opportunity for new bacteria to colonize. And these deficits are partially heritable.