I actually disagree, I think! I'd much rather do a shitty job with genuine friends than a "good" job with typical coworkers or worse. I too have formed very close bonds at my current place of work. I left them for a higher paying job that was better on paper and by most metrics easier, and the way I accelerated towards depression was really something. Got fired. Back at job with people I love. Hope nuclear winter takes me before corporate America takes my company.After working under the same person for the past ten years who I adore, pretty much knows me inside out and who has become a genuine friend it's looking very likely that I'll be moving to a new team (a similar role) and the manager will be the one person in the unit I don't particularly get on with.
I know the most important thing is the job itself but I think your relationship with management can make a big difference to your job.
If you do move teams, make a point to keep those friendships, especially with your supervisor. That's the shit that matters in life, I've found.