There's quite a few ways it can be done. But the important thing to remember is that Bankruptcy status is based off Cash-on-Hand, not on Net Worth. You can have a great Value and no Cash or vice versa.
Probably the most prevalent reason you see that is due to Loans.
Say you took out $300M in loans and spent that money on Plane orders. You have $50M in cash-on-hand but $300M in liabilities -- leaving a Net Value of $-250M. But you've got plenty of cash, so no problem.
An airline also gets a full real week (in most cases) to get out of bankruptcy. And that clock resets if they ever post a substantial positive cash flow. So an airline can get into trouble, get deep into negative cash and a few days into their warning. But say that they then sell some aircraft they owned and get a big boost to their cashflow (but still negative on-hand) and the clock will reset because the "Bank" thinks they're making they're way out of bankruptcy and cuts them a break. They will then get another warning the next game-week which can last several more real-days. Doing this a company can have negative cash-on-hand for a very long time, more than a few real-life weeks sometimes.