So sorry
My 9 yr old ds is just coming out of something like this (I hope), I know that there are specific things that are going on for him that are difficult, but none of them have really changed, just his outlook has, iyswim.
We tried different things, hard to say what's had the most effect;
Dp and I making effort to spend time with him without other dcs, not always easy, I know.
He was feeling lonely at school too, and doing one or two easy out of school activities with different children, or in one case with one child in his class who he gets on better with, has given him the chance to get a bit of social confidence back. It was very hard to persuade him to go, though; had to bribe him, but it was so worth it.
He's taken up a 'cool' musical instrumennt with lessons from a young, funky teacher. This has definitely meant a lot to him, he's feeling 'grown-up' in a non-threatening way, has something to work hard at when he is alone, and can see his progress.
I've also taken him to a homoeopath, specifically one who does counselling as part of the consultation, which I think might feel less pressurising for him than saying 'you need a counsellor.' Have no idea if it's the remedies or the talking that's been most helpful.
Are school being helpful?
I really feel for you, I was feeling absolutely desperate for my ds a few months ago, it's so hard and horrible to see them so unhappy.
Hope any of this is of use to you {{{hugs}}}