Linguistics is based on the genetic relationships of languages, groupings are allotted according to those formations.
Albanian is a unique, isolated language within IE, and Berber is its divergent separate respective branch within AA and consists of several languages. Somali is very unambiguously nested within Cushitic. These associations are never thrown willy-nilly.
Interesting, according to a spesific statistical measure, Arabic and Shehri (Modern South Arabian) is as far appart as Somali and Afar:
View attachment 315651
View attachment 315652
View attachment 315653
Now, there is potential complications with methodology in what you want to measure and if that is proxy for various relatedness factors but I think it is an interesting feature they set up to illustrate. I have to also set the caveat that divergence is not consistent, or regulated by exact same rate of innovation, loss of similarity, etc.