I have this too, and know well how unpleasant it is.
My gastro diagnosed it as IBS too, but like you I suspect there is more to the story than that, and that it is likely treatable. I have plans to try to tackle possible candida issues and see if that helps any.
In the mean time, I've coped by cutting out most of the foods I used to eat. At first I didn't think the problem was related to specific foods because it happened every time I ate, but it turns out that there were just so few safe foods that I was almost always eating a trigger food. For me, anything sweet or carb-related tends to set it off, along with some other food items. So any fruits, some vegetables (esp squash, sweet potato, etc.), rice noodles, etc. will blow me up like a balloon ready to burst. I still eat some of my problem foods (like nuts) just because I need to eat a certain amount of food per day and am low on options, but the reaction to them seems less severe so I can manage it. It's not a pleasant way to eat, but it has given me a lot of relief.
Good luck to you in working things out. I do think it's connected to the ME/CFS issues. And I feel your pain.