I have a close friend who suffered in a similar way.
He would always need the toilet. We played Sunday league together, often he'd be the last person to get on the pitch because he'd be in the toilet. We'd play golf and he'd have to be in the final group because he was in the toilet. He'd never get a taxi with us on a night out, he'd always make his own way because he'd be late because he needed the toilet. He'd keep a pack of toilet roll in the boot of his car and was terrified of getting caught in a traffic jam and once did have to run into the woods on a journey home.
And then he decided to go and get therapy and it changed everything. He'd always suffered with anxiety and then it helped him understand that he was in a terrible loop. He was anxious about things which would cause his stomach issues but then he would become more anxious about his stomach and then that would cause his stomach issues to get worse.
It took medication and therapy to help him and he's completely different today.
These issues can be fixed. You just need the right help