Most contracts don't survive the bankruptcy proceedings. The people who signed the contract should have been cognizant of the fact that there was some risk involved. If you sign a contract saying that you'll paint my fence and you die before you deliver, I have no recourse to insist on the enforcement of the contract and that is a risk I take by entering into a contract with you.
In the specific case of bankruptcy proceedings, the presiding judge has carte blanche to do whatever they feel is necessary to make the company viable. The welfare of the employees and customers are the primary consideration, but viability often means voiding many of the contracts that make a company non-functional as a business entity. In this case, the judge clearly decided that the burden of the companies existing retirement contracts prevented the solvent operation of any future incarnation of the company and therefore voided them. But at least some people will still have jobs. In the view of the bankruptcy court, it is better to have something than nothing, and it is their job to make the company look sufficiently palatable that someone will risk taking on the investment and obligations of the post-bankruptcy company.
So what was or wasn't written in the employee contract is immaterial. There is no such thing as a risk-free life and people who blithely prance through life under the assumption that everything will always turn up roses is a fool. It is the folly of always assuming someone will take care of you. Yeah, it sucks, but so does death, taxes, and a truckload of other things.