NeXT soaked up over $1 billion in investment about a decade before selling to Apple. If it's a success now, it's only because if you traded your NeXT stock for equivalent Apple stock in 1997, it would probably represent a significant return on the money invested in NeXT in the 1980's. But you'd have gotten an even better return by having that money in federal bonds between 1985 and 1997 (and then investing it in Apple) rather than having it in NeXT.
And NeXT's software is pretty much driving Apple's product lines now.
Which is a pretty good result for a 'failed company': Get paid $429 million to take over a larger company, and watch the technology you developed blossom to its full potential that was never possible as a tiny fringe player in the market, contributing to massive, overwhelming, record-smashing success.