This is a software company, so let's assume US west coast, maybe California. In California, there's notice requirements for larger employers terminating large percentages of their workforce or closing a plant or office. I think there need to be about 75 total employees for the California WARN law to apply, which I think is more than Carson employed.
"Illegal" implies a crime or misdemeanor, but running your business poorly isn't usually a crime. Assuming most or all employees had contracts, there would be obligations that would need to be met under the contracts, but those vary, and violating a contract is also not a crime. Most employers are going to try to make the most favorable contract they can, and it's the employees job to make sure they get all the protections they need. Most don't, though. So there could be terms that include the right to terminate employment (and pay) immediately. This is fairly common, even in California. If the contracts were fair and included severance pay, violations can be remedied in civil court to make wronged parties whole, but that takes time. Furthermore, it's not clear if "sold the business" means that selected assets of the business were sold, and the actual entity closed down, or if it means that the whole business was sold. If the whole business was sold, then responsibility for employment contracts would have transferred to the new owners, but if just certain assets were sold, then Carson's business still technically holds the contracts. This only matters for figuring out who to sue.
Thank you for attending the introductory lecture of Business Contracts 101. If you have any questions, office hours are Tuesday mornings 6:45-7:30am Eastern Standard Time. Please check your syllabus and read pages 15-89, and 133-201 of the textbook before the next class.