That situation is the consequence of too protective laws for working in France. In France, it is very difficult to fire someone, so it leads to problems when you want to decrease the number of staff.
You are right for private employment, but those people were hired under public servant contracts in a public company at the time, with lifetime employment guarantee.
So you are correct, employment is too protected, both in private and public sector, but in addition, the state promises too much. I have seen so many public servants being harassed and/or depressed because they didn’t fit/like their job, that I confirm lifetime jobs make no-one happy.