To make matters worse gas peaker plants cost approximately €1mln/MW as well, so at the cost of that plant you could have massively overprovisioned solar, backup gas plants and plenty of money for fuel to spare which you wouldn't be spending immediately, so it could be invested instead.
For 2023 and 2024 EDF was profitable, with net income of those two years exceeding that 2022 loss.