1. Sun didn't become the defacto desktop platform because they lost out to WinNT. So they lost out on the consumer market. 2. Custom server hardware and software makers like Sun and Silicon Graphics were the fashion till Google and later on Facebook came around and built their own data centers with consumer hardware and specialized software to overcome the inherent unreliability of that hardware. And anyway ever since web-based software became a thing your device is practically a console a la Chromebooks. So they lost the server market.
The only option left was to serve the high end HPC market like labs or even banks but that didn't make business sense since that's increasingly niche because those customers would eventually also want the effects of commoditization.
[1] - http://esr.ibiblio.org/?p=6279 [2] - https://www.joelonsoftware.com/2002/08/30/platforms/