Why can't someone have their money restored if someone they paid in advance goes bankrupt?
That’s how bankruptcy law works. Every entity that is owed money - including firms that sold products to the bankrupt, workers - wait inline to get paid back according bankruptcy laws.

The state cannot make everyone whole, as that would just encourage fraud. E.g., create a shell company, get rich friends to lend it money, take the money out and declare bankruptcy. Your friends get their money back from the government, and you get their hands on the proceeds as well. You make it worth their while by passing them money back under the table.

The state could bail out certain groups, but that’s an entirely a judgement call by the legislative body.