I'd be thinking cross contamination with glutens or his nut allergen first. Particularly, gluten free staples and foods (including flours, oils, gluten free cereals, crackers, etc.) are almost always cross contaminated with either nuts or sesame (which nut allergic people are often allergic to sesame as well). Rob's Red mill flours have heavy nut contamination, all my oils had nut contamination, my spices had sesame contamination, all our gluten free cereals had nut contamination, all our gluten free crackers and rice cakes had sesame contamination, etc. They may know this but if they didn't (I didn't) this is the first stop. I really struggled to find even a safe flour to use for baking for him.
That was the issue with my nut allergic gluten free son. He was getting diarrhea because he was consuming trace nut constantly. Gluten should be out of this kids house also as it can cross in toasters, non stick pans, crumbs on counters and in jelly (side note our jam had nut cross too...it's been a nightmare here).
I can give them my list of nut free gluten free staples if they would want that. Actually, I posted it on a recent thread about allergen free O's cereal.
Pull every bit of cross contamination and if he's still not better I'd suggest a metametrix stool test to see if there is anything going on like parasites or bacterial overgrowths. This is more common that you would imagine.
If that's clear I'd wonder if he's been scoped for EOS disease and that would be my next suggestion if that hasn't happened-pediatric GI would do this. However, knowing what I know about the problems with nut contamination in gluten free everything I'd lean toward that being the issue.