I am a big fan of NeXT and I agree that OPENSTEP (the name of NeXT's operating system at the time of purchase) was superior to BeOS. However, I don't think OPENSTEP vs. BeOS was the main factor that led to Apple's revitalization. After all, there was still a more than four year time period between the purchase of NeXT (December 1996) and the release of Mac OS X 10.0 (March 2001). The fact is despite OPENSTEP's solid Unix underpinnings and its sophisticated object-oriented API (OpenStep [note the spelling difference], which became Cocoa), Apple still had a lot of work to do to make NeXT Macintosh; simply porting OPENSTEP to the PowerPC and calling it a day would have disappointed many Mac users and developers, even if OPENSTEP was technically superior to System 7.

Apple's first attempt at making OPENSTEP Macintosh, Rhapsody (https://en.wikipedia.org/wiki/Rhapsody_(operating_system)), which was essentially OPENSTEP with the Classic environment (then called Blue Box) and a Copland-inspired interface, was rejected by large Mac developers since they'd have to rewrite their software using the OpenStep API; existing Mac software would have to use Blue Box, which didn't take advantage of any of the features that differentiated Rhapsody from the classic Mac OS. Apple responded to this criticism by creating the Carbon API, which is closer to the classic Macintosh API and made it easier for Mac developers to port their existing software to the new OPENSTEP-based operating system, which was renamed Mac OS X. Had Apple purchased BeOS, it still would have required much work making BeOS more Mac-like, including the development of a Carbon-style API to ease the porting of Macintosh applications.

I believe the biggest reason Apple survived the four-year cycle from OPENSTEP to Mac OS X 10.0 is because Apple made compelling products such as the original iMac and well-received Power Macintosh and PowerBook models once Gil Amelio was fired. These Macs still ran the rather creaky Mac OS 8/9, but this was at a time where there were still many people out there who never owned a computer; personal computing was still an expanding market in 1998 and 1999. Of course Mac OS X's development kept developers interested in Apple, but the sales of iMacs and other Macs of the time kept the lights on at Apple until Mac OS X shipped, and even then it took until the days of Jaguar (2002) for the majority of existing Mac users to switch from the classic Mac OS to Mac OS X.

I think in an alternative timeline where Be was purchased instead of NeXT, Apple could have still survived had it released compelling products in 1997 and 1998, but it would've been harder without Steve Jobs since he provided excellent leadership, especially with trimming down Apple's sprawling product line and focusing on well-designed hits like the beige Power Macintosh G3, the iMac, the Wallstreet PowerBook G3, and other well-received Macs. The worst case scenario would've been either Apple's bankruptcy or acquisition by Sun or HP by 2000.

Another thought: Looking back, I find it quite amazing that the time between the purchase of NeXT and the release of Mac OS X 10.0 (December 1996 to March 2001) is longer than the amount of time Apple spent working on Copland (1994-1996), though it's not as long as the time Apple/Taligent worked on Pink (1988-roughly 1995).