It's impossible to guess from what you've posted. And anything any of us says on here would be a guess even with much more information. Your GP is the best starting point so hopefully something will come of today's appointment.
Do you have a "gut feeling" (no pun intended) about all this? I know of a couple of mums with dc with stomach pains and nausea that developed late primary school in one case and early secondary in the other. They were told it was all stress related but the mums didn't believe it. Both dc ended up being diagnosed with medical conditions.
My ds3 has hardly been in school since the end of Yr 5 (now Yr 11). He started with a medical condition but all the stress around it, and trying to appear "normal", as teenagers like to be, he's ended up with anxiety and low mood which just make everything worse. So he's got a mixture of physical and psychological factors making him ill.
Does ds normally open up if something is upsetting him? Is he normally very sensitive? Any friendship problems? What does the school say?
Do the stomach upsets happen at the same time of year - bear in mind that if it does this doesn't necessarily mean it's psychological. My ds1 has severe allergies and was always more affected in October - March and usually was much better in the long school holiday although he did have hay fever. Some school staff kept telling me he was ill because he was stressed about school but I knew he wasn't. An allergist pin pointed how different allergens were affecting him and established it was the allergies and not anxiety that caused his health problems .
So, my advice would be to still keep an open mind, continue to do detective work about anything that might be worrying him (I'm sure you're doing this already), take on board any advice from the GP and then see how things progress. Keep the school up to date with what is going on and perhaps see if your GP will do a letter (some will charge for this) confirming that these stomach issues are genuine as this will keep them off your back for a while regarding attendance.