this cliche is so often repeated that i'm now questioning whether this is even true.
unions are counterproductive many times - they serve the interests (only temporarily) for the incumbents while failing to or ignoring the larger consequences like the whole company or industry declining.
i wonder if the HR cliche is similar.
If you belong to a union, you are the incumbent that the union exists to serve. Depending on the union's bargaining power, it may or may not succeed in representing your interests, but it has your interests as a central goal.
> they serve the interests [...of] the incumbents
Yes. The employees. That's the point.
> while [...] ignoring the larger consequences like the whole company
Good. That is, again, the point - to advocate for the employees when their interests are in opposition to those of the company.
You say they're counterproductive - sounds like they're working exactly as intended.
The cliche about HR doesn't mean that HR can't ever be helpful to you, just that they are incentivized to be helpful in ways that help the company. For example advising on how to best use benefits to keep employees healthy or recover from an illness or injury so they can return to work.
But if your needs as an employee go against what is best for the company by costing money, productivity, or creating risk for bad publicity, or they go against high level managers or executives who hold outsized sway with HR, then it will be difficult for you to get help from them.