What's the phrase for the situation where "doing A is valuable because it ledas to B, but you achieve A in such a way as to negate B". Something like this: "detailed writing is valuable because it helps readers understand the topic; but a writer who focuses on detailed writing and forgets the reason for it risks becoming verbose and confusing the readers instead". I think there's a saying or idiom that describes this situation via an example - it's on the tip of my tonuge, but I can't for the life of me pin it down.
It's not quite the same as Word for someone who focuses on the smaller details of a bigger problem; here, I'm talking about the sense in which you take actively counterproductive actions because you've lose sight of the big picture. Word for focusing on the details to the detriment of the whole? seems like the same question, but was marked as a duplicate of the first question linked, which doesn't seem quite accurate - and both those questions are looking for words, I'm looking for an idomatic expression akin to "throwing the baby out with the bathwater" - only that phrase (in its most common useage) suggests excessive zeal leading to negligence (don't lose sight of the good in your haste to eliminate the bad), rather than misplaced zeal actively undermining your own goals (don't sabatoge yourself by overzealously focusing on intermediate goals).
Does such an expression exist, or is my memory misleading me?