Did they do an Xray? My daughter had a similar problem, but her symptom was very different. Drs. also said it was in her head, but it was really a physical obstruction, and very fixable! When she was in 2nd grade she would throw-up for no apparent reason, no fever, etc. and then she would feel ok w/in a 1/2 hour. We went to specialists for blood, brain, pysch., etc. We found out the problem by accident. It was a GI who wanted to do a rectal examine but my daughter put up such a fight it was impossible, so they did an x-ray. She was so backed up in her intenstines that the waste cud not go thru, it came back up. Imagine the shower drain. Each day a small amount of hair gets down the drain, and if it does not go all the way thru, eventually the drain will back up. At the time Miramx was an RX and the dr. prescribed it 3X/day, as well as being very strict with a hi fiber diet and eliminating white flour and refined sugar (not forever, but until the issue was resolved). I don't remember if they also gave her another RX, this is going back several years.
Also, my friend's daughter held in her #2 for home. The girl had a fear of public restrooms and wouldn't even go in school for the whole day, or at a friend's house for a sleepover. Also around the same age, 2nd grade. Her dr. told her to give her a tablespoon of mineral oil 3X day and an RX for a special hi-fiber apple juice. I don't know how she got over the fear, but eventually she was able to go w/o it hurting or being scared.
Both girls are now in HS and very healthy.
As an adult, I've had these issues myself due to medical problems (I'll spare u the details!) but what has helped the most, in all areas as well, was yoga! There are certain excersies specifically for the intestines, and the yoga instructor explained, by certain stretches, you are massaging the internal organs, helping them to work more efficiently. And believe me, I am not a yogi with both feet on the back of my shoulders! There are yoga classes for kids now, and also yoga therapists, maybe your insurance might know of one? Some insurances are now covering or partial covering alternative therapies.
A happy and HEALTHY New Year to you and your daughter and son!
J.