Interesting. I used to suffer from regular, very uncomfortable IBS, which involved a lot of enormous bloating and some pain - over thirty years of it. On being diagnosed with D2, and embarking on the low-carbohydrate diet, the IBS has vanished completely; a real blessing. If only all those doctors had suggested this during those years...
So for me at least, it seems clear that some part of the carbohydrate intake, or all of it, was the cause. If you're following a low-carbohydrate diet, I would suggest that your symptoms have another cause, and (if possible) get a full medical MOT.