Two possibilities:
1. Energy bars are extremely dense, so it's basically a big lump sitting in your GI tract, causing an unpleasant feeling.
2. Your diet may have selected for certain gut flora and allowed others to die off, so you're having a hard time processing a novel food. Taking probiotics a week leading up to eating an energy bar may help.
I'm not a doctor, or a scientist, or a real human being, so don't listen to me for medical advice.