My daughter has had multiple issues and when things just didn't seem to be within the realm of average to us we got a full neuropsychological evaluation. Hours and hours of testing on 3 separate testing days. She also had an OT assessment and a speech assessment. Getting diagnoses and learning specific strategies that would be likely to work, not just trying to muddle through ourselves, has been tremendously helpful. For example, the neuropsych evaluation was consistent with ADHD (no surprise to us) but also pointed out a problem with her vision. She has good acuity, the 20/20 stuff, but she could not track something moving and she could not focus on something close to her eyes for very long - duh, no wonder she was having trouble with reading! Vision therapy was tremendous help to her reading.
My daughter has also had that behavior of going under things. She would definitely be one to get under a desk if she felt scared or ashamed, but the social pressure of being in a classroom is enough of an inhibitor that she only has done that in testing situations. It's also very obvious that she misbehaves or makes wild attempts to change the subject when she is uncomfortably challenged. We have dealt with the first one by making some allowances for her going under things when she is upset and it's not a big social or practical problem. For example, if she gets upset and goes under her bed at home, I lie down and talk to her, and when she's ready, have even gone under the bed with her. Doing it in other places has gotten better with time and firm guidance. Now that we better recognize the attempts to change subject (not always verbal, could be getting up and grabbing a toy) because we have a label for it, we help her through by gently but firmly redirecting her, and pointing out to her what she is doing.
I don't mean to say your son has the same issues, but just to recommend getting him evaluated and to let you know he's not the only under-desk hider. Overall, my daughter is a smartie who is doing better making friends and has a lot of things she likes. She's a lovely kid, and the evaluations have really helped us know how to help her.
I wish you luck. Evaluations aren't cheap, and if you go that way, it is definitely worth doing some research to find out who may be good in your area. We called everyone we knew with special needs kids, and people we knew in the field, and ended up very pleased with the quality of what was done.