> and the old company is now owned by the new company
That isn't necessary. The old company could legally just cease to exist, with its assets transferred over to another entity.
Liabilities also transfer.
If they're bundled somehow, sure. Otherwise, the owners of the old company could choose to retain those liabilities and sell only the assets, could they not?
Then the old company would still have fired them.
The sale is not complete until debts and liabilities are settled. So either way, unemployment was going to be paid.