a Pyrrhic victory

Fortgeschritten (C1) formal

Winning but at too great a cost.

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