Chronic, significant gas production is sometimes a sign of SIBO (small intestinal bacterial overgrowth). There’s a test for it, but it’s not a great test, so some docs may not bother with it. When I had SIBO a couple of months of doxycycline cleared it up.