I have to wonder whether or not it could have a strong connection to what your diet is like. Another possibility could be the way your body processes certain things and/or any blockages. I'm very into holistic medicine and nutrition so from that perspective, it sounds like there is something your body is not breaking down properly.
For the most part, I only eat whole foods. I know that on the occasion where I make the (poor) choice of eating processed foods the consequences are similar to what you describe. My mom has had many bouts similar to what was described above. For years she was told it was everything from a bug to diverticulitis. One doctor said it was IBS as it would change from severe diarrhea to constipation almost instantly. Once she finally got sick of answers and treatments that were going nowhere fast she started doing her own research and came across Celiac Disease. Well she cut out gluten along with pretty much all refined foods and within 3 weeks the symptoms were resolved.
I now have an almost 2 year old whose gluten intolerance was obvious within a month of being born. She had constant colic, constipation, and what the doctor said was reflux. I was not ok with the idea of giving my infant Prilosec so I explored other options starting with the possibility of lactose intolerance. Since I was breast feeding I removed all dairy from my diet which helped some. Desperate for my little one to feel better I looked at the potential of Celiac being hereditary and then removed all gluten from my diet. I had a different baby within 24 hours.
Recently, while going through a bout of eczema, constipation, and vomiting, I discovered nutrition response testing as part of the Ulan Standard Process. On my first testing session I found out that my adrenals and thyroid had blockages. It also showed sensitivity to soy, rye, barley (no more beer for me) and that I had formeldahyde and several heavy metals hanging out in my body.
Once I removed the things I knew I was consuming the symptoms resolved within a week. Figuring out where everything else was coming from took a bit more work. I researched and researched and oh yeah researched. Come to find out that formeldahyde is in most fabric softener and the metals were from using drain cleaner and CFL lightbulbs. Now last night I went against my usual eating habits and I have the burps that taste like rotten eggs, stomach pain, bloating, fatigue, and diarrhea.
The whole point to this is that nothing should be discounted as a potential cause. Especially since we live in a time that most things we use and consume daily are processed beyond recognition and full of toxic chemicals. Pay attention to your body and what it's telling you. Clearly, something has to be a common factor between all these bouts. It could be your body just getting to the point of not being able to handle anything else being put in that it can't process.
Also, as a side note, depending on the medical system that you go to. Celiac disease and some other similar things are not accepted. I live in Minnesota and found out that Mayo Clinic more or less discounts Celiacs as an "illness".