Gastrointestinal complaints in children could signal future mental health problem. Researchers have linked disruption of a child's gastrointestinal microbiome triggered by early-life adversity -- such as parental separation -- with activity in the regions of the brain associated with emotional health. Source 8c.
The body and mind must have a certain amount of synergy to actually operate correctly. In this scenario the physical problem will eventually lead to a mental/psychological one to arrive as well. The opposite can apply, depending on the situation.