It is probably illegal to pay out to one party to the detriment of others if you are technically bankrupt, i.e. if you have less value on hand than you owe.
Wrong. There is always some seniority ranking on who gets paid and who does not is the case of Bankruptcy.
But the law certainly does not prescribe first-come-first-served.
Hell yes, that's what seniority is all about!
If true, this is something very specific to Japanese law. All over Europe there's no first come first serve - in contrary, the liquidator is allowed to reverse transactions took place even several month before filling for insolvency if a creditor has been preferred.