I just saw this thread, otherwise I would have replied earlier.
Last year, One of my best friends DD's had this problem.
This is a real and VERY upsetting situation. With the family I know the dd was in 4th grade staight A student, Never a behavior problem. 2 Very loving involved parents. A great family and a delight of a child.
I have known her since she was 3. She started school in September and was fine. She did get a teacher who had a reputation of being ( mean) But a few weeks into school she had no complaints and said she infact liked her. Suddenly mid October she started getting lots of stomach aches. She would be fine once the school day had begun. up and walking around. By the next Am she was sick again. This went on for at least a week. She was looked at by the pedi. He ruled out appendix, gallbladder etcc.. Still she refused to go to school. by week 3. The school was acting as if she were truant. It got ugly! They would all go to school in the Am Mom, dad, and child and try to coax and cajole her into school. She looked awful was disheveld and crying. Mom and dad were beside themselves. The scene was so bad they would come 20 minutes after school started so noone would be around. They were mortified and so confused. It was so upsetting.

BAck to the pedi who now sent her to a child therapist. 2 weeks of talking to the therapist still no closer to getting the child in the building. Then she was taken to a childrens shrink. Where finnaly he began to peice together what he believes caused a panic attack phobia situation for the child.
First the child that sits next to her threw up on his desk. ( YUCK) the kids were of course grossed out. And being so aware of social status at this age. very embarrassing for the sick child.
a few days later she was sleeping over her Aunts house 45 minutes away from Mom and came down with the bug, probably passed to her from the first child. She threw up all night in her Aunts house. Number one she wanted Mom, Number two she was mortified to get sick on Aunties rug.
Cut to 3 days later she goes back to school starts to feel a little sick panics because she is afraid she will get sick and be so embarrassed. Goes to the Nurses office to get sent home and someone is sick in the nurses office. all of those events set her up for a panic reaction. She honestly would be so worried she might get sick, her stomach would be sick. Plain and simple panic attack. There is no history of any panic attacks on either side of the family. Just like the perfect storm scenario it all just fell badly into line for her. Despite therapy, loving family and eventually the school understanding she was NOT a truant. She was put on anti anxiety medication. ANd after several months she went back to school. she was out October, november and most of December. She is back in school now this year no longer in any therapy, still on the medication. They will wean her off of it over the summmer.
ANd back to her adorable self.
Can you think of anything traumatic he may be thinking about? Any issues that may be causing him to worry? Its like dominoes look back to when it started and peice everything around that point together and see what you come up with.
Hugs to you, Its very upsetting and I have seen this situatiuon firsthand and seen it be resolved. So have faith it will be for you to. If you have any questions, feel free to ask, and I will do my best to try and answer you.