Earlier quoted context omitted.
Can you explain what you mean by this? It sounds like a contradiction, loneliness is bad but friendship is worse?
Bad friends can be worse than no friends, and a series of bad luck could make a person believe that the only friends are bad ones (alternatively unrealistic expectations could cause this too)
There is a bit more discussion on this in an old Hacker News thread from February 2020, where several people discuss the serious impact of unhealthy relationships in the quality of one's life: https://news.ycombinator.com/item?id=22214066