In many people chronic upper constipation and GERD are misdiagnosed as bacterial overgrowth. Unfortunately, they are often non-responsive to antimicrobial treatments. Yet, sometimes the issues improve greatly with vitamin B1 repletion. In this case, the "SIBO" diagnosis is simply a symptom of an underlying systemic problem with energy metabolism.
The gastrointestinal tract is one of the main systems that can be affected by a deficiency of thiamine (vitamin B1). Clinically, a severe deficiency in this nutrient can produce a condition called “Gastrointestinal Beriberi”, which in my experience is massively underdiagnosed and often mistaken for SIBO or IBS-C. The symptoms may include GERD, gastroparesis, slow or paralysed GI motility, inability to digest foods, extreme abdominal pain, bloating and gas. People with this condition often experience negligible benefits from gut-focused protocols, probiotics or anti-microbial treatments. They also have a reliance on betaine HCL, digestive enzymes, and prokinetics or laxatives.
Why thiamine is essential for maintaining a healthy gut
The GI tract possesses its own individual enteric nervous system (ENS), often referred to as the "second brain". Although the ENS can perform its job somewhat autonomously, inputs from both the sympathetic and parasympathetic branches of the autonomic nervous system serve to modulate gastrointestinal functions. The upper digestive organs are mainly innervated by the vagus nerve, which exerts a stimulatory effect on digestive secretions, motility, and other functions. Vagal innervation is necessary for dampening inflammatory responses in the gut and maintaining gut barrier integrity 
The lower regions of the brain responsible for coordinating the autonomic nervous system are particularly vulnerable to a deficiency of thiamine. Consequently, the metabolic derangement in these brain regions caused by deficiency produces dysfunctional autonomic outputs and “misfiring”, which goes on to exert detrimental effects on every bodily system - including the gastrointestinal organs.
However, the severe gut dysfunction in this context is not only caused by faulty central mechanisms in the brain, but also by tissue specific changes which occur when cells lack thiamine. The primary neurotransmitter utilized by the vagus nerve is acetylcholine. Enteric neurons also use acetylcholine to initiate peristaltic contractions necessary for proper gut motility. Thiamine is necessary for the synthesis of acetylcholine and low levels produce an acetylcholine deficit , which leads to reduced vagal tone and impaired motility in the stomach and small intestine.
In the stomach, thiamine deficiency inhibits the release of hydrochloric acid from gastric cells  and leads to hypochlorydria (low stomach acid). The rate of gastric motility and emptying also grinds down to a halt, producing delayed emptying, upper GI bloating, GERD/reflux and nausea . This also reduces one’s ability to digest proteins. Due to its low pH, gastric acid is also a potent antimicrobial agent against acid-sensitive microorganisms. Hypochlorydria is considered a key risk factor for the development of bacterial overgrowth. The pancreas is one of the richest stores of thiamine in the human body, and the metabolic derangement induced by thiamine deficiency causes a major decrease in digestive enzyme secretion  . This is one of the reasons why those affected often see undigested food in stools.
Another reason likely due to a lack of brush border enzymes located on the intestinal wall, which are responsible for further breaking down food pre-absorption. These enzymes include sucrase, lactase, maltase, leucine aminopeptidase and alkaline phosphatase. Thiamine deficiency was shown to reduce the activity of each of these enzymes by 42-66%. .
Intestinal alkaline phosphatase enzymes are responsible for cleaving phosphate from the active forms of vitamins found in foods, which is a necessary step in absorption. Without these enzymes, certain (forms of) vitamins including B6 (PLP), B2 (R5P), and B1 (TPP) CANNOT be absorbed and will remain in the gut. Another component of the intestinal brush border are microvilli proteins, also necessary for nutrient absorption, were reduced by 20% in the same study. Gallbladder dyskinesia, a motility disorder of the gallbladder which reduces the rate of bile flow, has also been found in thiamine deficiency .
Together, these factors no doubt contribute to the phenomena of “malnutrition induced malnutrition”, a term coined by researchers to describe how thiamine deficiency can lead to all other nutrient deficiencies across the board. In other words, a chronic thiamine deficiency can indirectly produce an inability to digest and absorb foods, and therefore produce a deficiency in most of the other vitamins and minerals. And sadly, as thiamine is notoriously difficult to identify through ordinary testing methods, it is often missed through routine testing.
To summarize, B1 is necessary in the gut for:
Stomach acid secretion and gastric emptying
Pancreatic digestive enzyme secretion
Intestinal brush border enzymes
Intestinal contractions and motility
Vagal nerve function
How thiamine can support the gut
The ability of thiamine to address these issues has been known for a long time in Japan. Specifically, the form of thiamine shown to be superior in several studies is thiamine TTFD, the main ingredient in Thiamax.
One study investigated the effect of TTFD on the jejunal loop of non-anesthetized & anesthetized dogs. They showed that intravenous administration induced a slight increase in tone and a “remarkable increase” in the amplitude of rhythmic contractions for twenty minutes. Furthermore, TTFD applied topically inside lumen of the intestine also elicited excitation .
Another study performed on isolated guinea pig intestines showed provided similar results , where the authors concluded that the action of TTFD was specifically through acting on the enteric neurons rather than smooth muscle cells.
Along with TTFD, other derivatives have also been shown to influence gut motility. One study in rats showed an increase in intestinal contractions for all forms of thiamine including HCL, BTDS, TTFD, and TPD . Another in white rats also found most thiamine derivatives to be effective within minutes .
Most interestingly, thiamine derivatives were studied in mice with artificially induced constipation by atropine and papaverine. The researchers tested whether several thiamine derivatives could counteract the constipation – TPP, Thiamine HCL, TTFD, BTDS (S-Benzoyl thiamine disulphide - somewhat similar to benfotiamine). Of all the forms of thiamine tested, TTFD was the ONLY one which could increase gut motility. Furthermore, they ALSO showed that TTFD did not increase motility in the non-treatment group (non-poisoned with atropine). This indicated that TTFD did not increase motility indiscriminately, but only when motility was dysfunctional 
Finally, severe constipation and gastroparesis have been identified in patients with post-gastrectomy thiamine deficiency, and three days of I.V TTFD at 100mg followed by 75mg orally produced improvement in gastroparesis within a few weeks . I have personally witnessed TTFD to have remarkable results in a sub-group of people with chronic gut issues which were unresponsive to other therapies.