Stress and anxiety can cause digestive symptoms.
I've had it described to me in the following way; stress creates physical manifestations of that stress, those physical manifestations create discomfort, that discomfort creates stress. The feedback loop, once in place, can accelerate the anxiety. It can also be used to shut the anxiety down. It is possible to focus on the physical manifestations and "cut the strings" of the cycle by relieving those symptoms through meditation and treatment. You're left with the original stressor, but the feedback cycle doesn't help you get better as long as it is active.
That sounds very much like the approach a software/hardware engineer would have towards a bug. And it's great!
However, I'd say that the human body can't really be approached that way because of its, very much, inconstant nature (at least until we've figured out 100% how our bodies function).
In the current state of knowledge human kind has about biology, it would be very hard to pin-point a "bug" (IBS/stress/anxiety for example) to a specific root cause (bacteria x or y). On the opposite end, a software bug ultimately has one (or multiple) very much identifiable root causes.
All that to say that, it might not be possible to understand the causes of IBS/anxiety/stress, and thus, treating the symptoms might actually be the cure. (who knows, maybe treating a "biological bug" fixes the actual bug?)
It's also a chicken and egg problem: which started first? IBS or stress/anxiety?
In terms of IBS, there is very little doubt that in my own situation that stress causes the IBS rather than the other way around. Diarrhea during the week, followed by constipation during weekends. Or diarrhea preceeding before a novel event. These are repeatable and predictable - it just requires taking a close look at your situation and seeing if you can see any correlations. Unfortunately it can be easy to get fooled into seeing correlations that don't exist.