I was diagnosed with Crohn's 14 years ago and suffered from significant and worsening brain fog symptoms for the past 7 years or so. A couple of years ago I started an experimentation process during which I tinkered with every dietary variable I could think of, and experimented with literally dozens of supplements to try to alleviate this issue, and the thing that has helped me the most has been reducing my fat intake.
I was eating a relatively high fat diet (I regularly added oils after cooking, consumed generous helpings of high fat snacks almost daily, and my #1 protein of choice was the highest fat salmon I could find), and a few months ago when I turned my attention on the fat variable, and decided to cut fat containing foods to assess how it might affect my brain fog, the results were dramatically good. Quite simply, I find the lifting of the cloud on my thinking, memory etc to vary directly with limiting the fat in my diet. I am a different person now. And while I imagine most people would not characterize their diet as being high fat necessarily, I believe this might help those of us on a "normal" fat diet too. I now eat a low fat diet, as low as I can go really, and when I deviate, I feel it, I find that to that degree the fog comes back.
After my discovery I found an article that might very well contain the scientific reason/support for it. https://www.shape.com/healthy-eating/diet-tips-nutrition/zombie-diet-way-you-eat-causing-you-lose-brain-cells. And the article links to a study "High-fat diet prompts immune cells to start eating connections between neurons". While the article isn't specifically about
IBD it makes sense that the impaired ability to properly digest/absorb fat and the inflammation might cause the exacerbation of what it's discussing (and the study specifically references chronic inflammation as the underlying culprit).
I would note that despite that high fat diet I used to consume (for several years, I think the genesis of it was just the idea/fear of not consuming enough calories to sustain/increase my weight), and the normal fat diet I was on before that since my diagnosis (at age 16, I'm now 29), none of that fat was sticking around, I've always been somewhere on the moderately underweight (when not flaring)-severely underweight (when flaring) spectrum.
Best of luck to all
Sam