> not the devs they manage
This is a big part of the problem; PMs should be managing the product, not managing developers, though it almost always ends up being the latter. The same goes for project managers, who should be managing the project, not the developers.
Though PMs should be working closely with developers, the idea that developers are subordinate to them is pretty silly when, ultimately, their incentives are heavily weighed towards siding with product owners and upper management in general. The role of PM doesn't suggest any sort of qualification for managing developers, thus it makes more sense for developers to be managed by lead or staff developers who report to directors of technology or product owners. Unfortunately, this can be dysfunctional because roles like "lead" are often given to those who don't have good leadership or management skills. However, it still makes more sense that developers are lead by developers who answer to whomever owns the product. When you add a PM in the middle, they often act more as a blame-diffuser when their actual job should be like an interface between developers and the business, and to provide some amount of defense for the developers they supposedly manage.