I have been thinking in the same direction, but, there could be something to this. We are, after all dependent on the enormous diversity of bacteria in our gut, and everyone has a different mix. You could quite literally transplant the bacteria of a healthy person into a gastro problematic patient and see positive improvements.
You could do the same experiment and have negative results.
I think there is a significant genetic connection with the microbial flora in individual hosts.
So, if there was a population that had adapted to intestinal worms for generations to modulate digestive chemistry and flora, it could hypothetically have immunological consequences (hence) genetic conectiveness as well.
Just a thought. Shroom