I eat a tremendous amount of fruits and vegetables but then I get bloated.
Everyone's system handles food a little differently. I used to eat broccoli twice a week because "it's good for you". But it's also gassy AF. Now my body really can't even handle it so I don't eat it anymore.
Same with apples, plenty of fiber and they help you shit but I noticed they make me gassy.
You have to find a balance that's good for you.
It's good to get information from books and online but there really isn't any cookie cutter system that will work with everyone
I have these discussions about diet all the time with the people I workout and run with.
Everyone has there own ideas on how much meat you should and shouldn't eat, what time of day you should eat (fasting).
But in the end, see a doctor, get a full blood work up and discuss your bowel habits.
What's ever going on in your gut can probably be fixed with some diet changes.