It wasn't marketing. Their products were just bad. Late model SPARC devices were trying to compete with Intel Coppermines that were literally twice as fast and three times cheaper. There was a brief moment where it looked like a pivot to software (via Java) might save them, but Microsoft killed that. Then very late they tried moving to x86 hardware themselves, but by then Linux had reached feature parity and passed Solaris in performance.
The final knife was the cloud. AWS was a huge paradigm shift for how one provisions hardware to Unixy software, and Amazon was a Linux shop and Solaris had nowhere to fit.