Flora and bacteria in your stomach help break down your foods in your stomach. Poor breakdown or absorption of food caused by flora is a small factor, the only outcome of an imbalance in stomach bacteria is poor nutrient uptake, and improper food breakdown, which can only cause you to expel what has not been digested properly.
It is seen in those with IBS, a decent way is to increase the healthy bacteria in your stomach which must have a balance with the unhealthy bacteria in your stomach. This is Lactobacteria, live active bacterial culture, found in yogurt. I have IBS and eat yogurt in the morning to try and soothe the symptoms, though a higher concentration of active cells is required. You can also try digestive aids, but they are usually very minimally effective (digestive enzymes)
However using a comparison such as the one you have presented is weak, as with IBS, lack of intestinal flora makes it hard to gain weight, I have found gaining weight not complicated, I have been able to gain 10 pounds in a month easily, energy in, energy out.
If you do have trouble gaining, eat more calories. Say your intake is 2500 calories a day and you upped it to 3000, and with no results you gained nothing? so put it to 5000. I agree with the prof on that, its about eating, not irregularity, as most people do, I know so many "hardgainers" and if you saw the way they ate, you would understand.
Protein isnt everything, you need fats and carbs, both simple and complex. It really isnt complicated.
And believe me, when you weigh around 280 at 6'7 and your daily food intake to maintain your weight is almost 5000 calories. Imagine trying to eat 7000 cals a day? Well its possible. Excuses are for losers, solutions are for winners.