Merce, your 'clever but quite geeky' DS reminds me of my own DS, now 11 and just started grammar school.
When my DS was at primary school, he was excluded by his classmates. I used to watch him in the playground after I brought him in, flitting around like an invisible child amongst the others. Even when the bell went, it was clear nobody wanted to stand too close to him when they lined up. He was sneered at or ignored, told to 'go away' or 'get lost' by all.
DS is now in Y7 with a completely different set of classmates ... and is fully accepted without having worked at his social skills or having tried to fit in.
I know that you feel your DS is the one who needs to improve his 'social intelligence' because he has experienced problems in two primary schools now, but I think that primary schools can often foster conformist micro-societies which reject the different - and more interesting! - children. Particularly when classes are small, as tends to be the case in private schools, children who deviate from 'the norm' can find themselves marginalised.
At secondary schools, horizons expand and the chances of meeting like-minded children increase.
As your DS is only 9, leaving primary school must seem a long way away, but I wanted to give you hope for the future.
You mention that your DS hits 'the wrong 'note' when he tries to make jokes/join in' and all this tells me is that he has a different - but no less valid - sense of humour/way of being. For example, bullies have a sense of humour which is based on competitive putdowns. Your DS may not be as quick verbally but may have his own unique off-the-wall sense of humour which does not rely on the discomfiture of others.
As for those children stuffing clothes in your poor DS's mouth - they might be popular and powerful within the class, but they are not socially adept. I'd give your DS a higher sociability rating than them, simply on account of his wish to be friendly.
Your DS should maintain his integrity, be his own wonderful off-beat self and not try too hard to fit in. His time will come!
Sorry, this has been long but these are some of the things I wish someone had said to me when my DS was suffering from exclusion at primary school!