This is generally good advice but not universal. I’ve seen how complaining about other teams within one’s own team stifles collaboration and can kill cross-functional projects before they get started. But also, if there’s a real problem on another team, there needs to be a channel for people to be real with their direct reports about the problems, so they can build a case to fix it. And if there’s a big and obvious problem that you wilfully ignore or talk around as a manager, it can also hurt your credibility with your team. So it’s a fine line, and one that I’ve never really seen walked perfectly. I’ve had C-level bosses who were constantly complaining about other teams. Happened to be one of my favorite managers actually.