a Pyrrhic victory

Avançado (C1)formal

Winning but at too great a cost.

"Winning the lawsuit was a Pyrrhic victory — the legal fees bankrupted the company."