Hey, I know this post is old but I've come across it because I was searching for answers as I am 29 and I still do this. I actually have an MRI booked to see if I've caused any damage to my brain as I've been doing it for so long.
I understand your child's frustrations. I was always told I would grow out of it, yet here we are 😄
I remember doing various things when I was a child, like rocking back and forward, banging my back on the wall, rocking side to side sitting down and standing up. With time and getting to know my dad's side of the family, they all have sleep problems so I think this is a mix of anxiety and sleep problems.
Still to this day, if I wake up in the middle of the night, I know I have work, so I can't be awake and I will do that until I fall asleep. We basically knock ourselves out.
It hasn't caused me any social issues, it hasn't affected my intelligence or the ability to empathise or be up to social standards and more, so I wouldn't worry too much. But, if you can help him in any way to stop, It will help him in the long run. I was always told never to tell anyone because people would think I'm crazy and the police would take me away 😂 so I'm now almost 30 looking for answers.