Spices can definitely irritate your guts. It's so individual. Certain spicy food actually helps me out. However, even the same spices cooked with different food (that I usually tolerate) will keep me planted in the bathroom.
I have the same issues with lying down. Basically, my guts seem more willing to move when I'm in bed. Also, I can only safely pass gas when I'm on my back.
Most nights I'll try to sleep, then feel urgency for the bathroom. I'll sit for 10+ minutes on the toilet and not be able to pass anything. I get frustrated, go back to bed, and immediately feel the urgency again.
My doctors have said that's just part of the anatomy. My pouch seems to be very well-constructed, but still very temperamental. There may be no good solution.