The study also explains that one feels less lonely when listening to their favourite music, which is kinda new to me. I mean, feeling better makes sense and is quite obvious, as you sarcastically say, but I wouldn't think that listening to music makes one feel less alone.
I wouldn't assume that sad songs make you more lonely. For someone dealing with grief, it may act as drug-free therapy. Perhaps deepened sorrow at first, but when one deals with grief, mental state and behavior can improve.
I think it's the opposite. Those songs are good because you find someone can relate to you and therefore you would feel less lonely. Maybe not less sad, but more connected.
When I work from home, I usually listen to Sade, Brandy, Monica, Faith Evans, and similar music. Although the music is often about heartbreak, it doesn't make me sad. I find it calming.