First of all, hugs, this must have been heartbreaking to witness.
I also think it is important, for both you and him, to realize that a lot of the issues are situational and that a kid that is friendless at one point in school is NOT a kid that will be friendless forever. It does take resilience, and I do not think a kid comes out unscathed, but maybe at some point it may make him more compassionate towards others who are lonely themselves.
Both DH and I have gone through years of being essentially friendless in school (for me, elementary was worst, for DH, middle school). We did have kids in the neighbourhood and kids we were in activities with to spend time with, but somehow school seems to be where being part of the group counts most. So a lot of my hard a work as a parent goes into helping my kids feel comfortable in school.
DS9 was essentially friendless in preschool, did much better in elementary, middle school starts next year and I am already nervous as he may enter a gifted program on the other side of town where he will know no one. The older they get of course, the more they have to take over and find their social groups by themselves. Right now, I still phone parents or families and arrange activities.
Just yesterday, I told DH that every single play date or activity with other kids that my kids enjoy *still* feels like a triumph. It is not enough to just work of social skills and pragmatics (though we do that, too) I have to encourage my kids to ask kids they like whether they want to come play, I phone moms and dads, drive places, completely disregard stuff like homework or instrument practice in favour of my kids spending time with others, and I make sure my kids don't notice the work that goes into it. It's that important to me. I also feel that even if a play date or activity doesn't work out that great, or the kids of the family that we do stuff with aren't perfect fits, they are learning valuable social skills every time they are not holed up with a book or in front of a screen,even though they might have to leave their comfort zones doing it. It is important to me that my kids think of themselves as social beings, who do have friends and do have play dates and get invited to the occasional birthday party. None of them are exactly popular - I know kids who have friends over every day, who are invited to birthday parties every month etc. I'm fine with fortnightly and quarterly, thank you very much, as long as they are socially active.
Sorry, this post is longwinded and disjointed because I am at work and can't focus, but I am trying to make a point. His ex best friend may ignore him in school for a while but might still come over in the afternoons when the other kids higher on the hierarchical scale aren't there. Some of kids who are at the bottom of the scale who only stare at their phones might jump at the chance to make friends with your DS, even though they may not turn out to be his besties. The kids in his scout group may not be his besties either, but at least he is part of a group there. It's a training period - he's been benched, but don't let him quit, withdraw into book or screen worlds, and he may be back on the team either at this school or a new one.