throw the baby out with the bathwater
v//θɹoʊ ðə ˈbeɪbi aʊt wɪθ ðə ˈbæθwɔtɚ//kasta ut barnet med badvattnet
(idiomatic) To discard, inadvertently or through overzealousness, something valuable or essential ("the baby") in the process of removing or rejecting something unwanted or undesirable ("the bathwater").