I live with IBS and although I'm better now, I was in a terrible shape for about 2.5 years. Very expensive rabbit hole of doctors and tests that lead nowhere. Long story short, this is true. Gut bacteria (an imbalance in the case of IBS) is a real thing. Never mess with your diet doing stupid stuff. Always be weary of anti-biotics. And if you're suffering a lot at the moment look up the low-fodmap diet from the Monash University. That's the only thing that really helped me.