There are a few ways that the court can get this money. Disclaimer I am not an expert in bankruptcy law.
The most obvious one is what you said. The court can order the company’s assets to be liquidated and then the proceeds of the sales would be distributed proportionally among the creditors.
Next they can go after the perpetrators like Sam Bankman-Fried and his crew. If they have any personal assets that they acquired as a result of their criminal activity at FTX, the court may be able to take some of that money to pay creditors.
Lastly is “clawbacks”. Let’s say you invested $1,000,000 in FTX and you were one of the lucky ones and happened to withdraw $10,000,000 in proceeds during the height of the scam. The court could claw back up to $9,000,000 from you since all of those proceeds were the result of a scam, even if you had no idea that FTX was shady. This is typically how the courts recover money from ponzi schemes like Bernie Madhoff
This works until you scale the team beyond 1 person and someone else needs to decipher the 30 line awk | sed | xargs monstrosity you created. Give me a real programming language any day.