How is it possible for a company to show positive net income but go bankrupt?

A: Two examples include deterioration of working capital (i.e. increasing accounts receivable, lowering accounts payable), and financial shenanigans.