No worries I wish you luck with the diet nutrition side of things. Also the amount of junk science you will have to sift through is a pain. I have struggled with this recently myself due to failing memory and being out of touch for a year due to being made redundant (I worked in the food industry).
Here is what I have found so far with some of my own speculation.
I think some poor nutrient absorption can definitely happen for various reasons and stomach acidity can be linked.
The only things that seem based on reliable evidence are that:
low stomach acidity can be related to:
If stomach acidity is low it can cause malabsorption of essential vitamins and minerals (low B12 absorption being one of the key markers, but also iron, magnesium, zinc and possibly calcium although that is contentious) and reduce the production of pepsin causing a less efficient protein digestion. CHO digestion is much more robust since we start digesting these as soon as we eat and acid even on its own can digest starch without amylase (generally). This is unlikely to be black and white so we are probably still producing a hell of a lot of stomach acid ...its just not quite enough to be our normal efficient.
We then go into a whole host of speculation from there on in and a lot of confused messages and confused thinking starts creeping in. I have lost count of the times I have read "nutritionists" or their like starting off with the above and then carrying on explaining how maple syrup is better than sugar or that bacteria can pass through the gut wall or that whole food groups are bad foods etc etc.
I think its safe to assume that low stomach acidity can be a problem and this may affect how efficiently we digest food and possibly have knock on effects further on. We know that Pepsin production is activated by HCL secretion as well as the acid denaturing the tertiary structure of the protein to allow the enzymes access to the peptide bonds etc. We also know that the pancreas and liver responds to a variety of signals following acid and pepsinogen secretion to allow their secretions to be timed correctly. This means that inefficient acid production can have a knock on effect for fat protein and CHO digestion in the duodenum.
Diarrhea is associated with irritation of the gut lining, infection, chronic illness, stress and interestingly high histamine (i.e. lots of things)
Bloating is associated mainly with the production of gas by bacteria in the gut
So something must be explaining the symptoms further down. In terms of bloating this could be an excess of nutrients (short chain peptides, short chain saccharides etc) causing changes in gas producing gut bacteria, but as with everything gut biome there is a lot of speculation due to lack of information. Diarrhea could be so many things its difficult to attribute it to diet when you have a chronic illness.
My gut issues (same symptoms as yours...the alternating diarrhea and constipation is a drag), have reduced a lot over the last 12 months. During that time I have been doing some things that may have had an effect:
diet: reduced carbs and sugar consumption (150g or below a day), moderate protein (50-100g), higher fat (50% of calories)
Supplements: B12, folate, B complex and zinc
Meal sizes: have reduced these to smaller meal sizes but more nutrient dense foods.
Of course this is totally anecdotal and there could be something else happening. I have gone from having 3-4 episodes of diarrhea a day ( and bloating and random constipation) to one or two episodes a month by doing the above. I used to get constant reflux symptoms but now rarely get these.
I still eat a varied diet just control the food groups and meal sizes a bit better than i did before. I am mild moderate so this may be a factor in terms of still being to move around more which I think also helps stimulate gut motility etc. Its possible that the supplementation with folate and B12 alone reduced high histamine and stopped diarrhea that way? Its equally possible that I'm entering a different phase (I am worse off cognitively and OI wise than I was a year ago?)
There seems to be little but theories to go on. I hope you find something that improves your symptoms and hope this hasn't been too preachy ...I don't really know how it worked but I'm sticking to my regime like some sort of voodoo just in case it has had an effect.