Managers measuring the wrong thing is not exclusive to software engineering. Measuring obviously wrong things goes back decades (ie IBM paying Microsoft by the KLOC).
This phenomenon was likely first identified by Deming. His Red Bead Experiment is infamous in demonstrating.
https://deming.org/explore/red-bead-experiment/
There's a lot of good research and advice from DORA on what to measure and improve.
https://cloud.google.com/blog/products/devops-sre/using-the-...