The thing is that if it's gut microbes, then good food will cause problems too.
I'll just leave this here. And over there, and there, and some over there, and some in the air... Of course, that's a virus, not bacteria, but the principle is the same. What's in the food can feed or kill off what's in your gut already, or the food can be contaminated, and the contamination can outcompete or otherwise interfere with the biota upon which you depend for proper digestive function. Either one can wreak havoc on your digestive system. And let us not forget antibiotics' influence on your GI tract. As we have produced greater numbers of more antibiotic-resistant bacteria through their overuse and misuse, we've led to more widespread and common use of the kind of antibiotics that are equivalent to the nuclear option when it comes to your intestines.