While I consider this hypothesis unlikely, but possible, there are things that could be done to investigate this idea directly (most likely at consuming a significant amount of personal funds if you are willing to find anyone to do them).
First, yes bloating or excessive intestinal gas disorders/diseases exists. While not a great journal, and one that uses industry standards that differ from more established guidelines, here is a review that should be more approachable to the public.
The first and most obvious would be to look for excessive intestinal gasses. This would be noted by increased flatulence, or if in an extreme case, a local build-up would be noticeable in a CT or X-ray. The fact that it is not moving around, but staying in your upper right abdomen, would mean that a local build up would be more likely, and thus more likely to be found in radiology. The fact that these tests were done, but did not yield results is evidence against the idea.
If you really want to test the output metabolome of your intestinal flora, you're probably better suited to test the volatile organic compounds (VOCs) found in your flatulence. A group in the Netherlands, who own the design to a particular electronic nose called eNose, published the idea of using feacal volatiles to "considerably improve screening, diagnosis and disease monitoring for gastro-intestinal diseases."
This is certainly not an FDA approved method, and again it was published in the same low-impact journal that caters to companies publishing about their own tech. The idea has merit, however a large database of samples correlated with successful diagnoses via other means would need to be established before this was of any practical use.
Finally, biopsies and swabs of the colon could be taken during an endoscopy, and the microbes present could be tested for. This could be compared to some growing databases of individual microbiomes from NIH's Human Microbiome Project.
I do not think that trying to starve your gut flora via lower sugar diet is likely to have any noticeable effects. Your GI specialist would have recommended any diagnostic diets to try if there was a likely test that could have been done (all liquid for example). Testing feacal volatiles or comparing your microbiome would be human medical research/experiments at best (beyond the care you would be able to get in most countries outside of a medical study like this one).
Under the assumption that you are asking this here, that you are not interested in other diagnoses, and your other questions regarding polyps and GERD, I'm going to assume that this a theory that your GI specialist didn't put forward or one they didn't agree with. They should be able to screen for the causes of your pain if it arises from an issue with your GI tract. On the idea that they haven't (and therefore this specific hypothesis), I would highly suggest you seek treatment from a pain specialist, to test for things neuropathic pain.