This is not true in practice because the consequences of bad code show up months and years later and in a way that makes it impossible to attribute to any one business decision.
> then you've basically just succumbed to Goodhart's Law
We're talking about adding more metrics that should be considered, and treating or not treating them as the ultimate goal is orthogonal to choosing the set of metrics! Product metrics don't save from goodharting