That's more of a tantrum move than a financial strategy move. It would likely have saved the company money of these two stayed on to help with the post-layoff chaos and prepare for the next round where they'd then depart and be done. That said, maybe their golden parachutes were large enough they opted to leave.
[0]https://www.cnbc.com/2023/09/27/flexport-loses-cfo-hr-chief-...