The big difference is, Google pulls stunts like that small things that aren't critical to the company's business. Microsoft, on the other hand, was blithely jackhammering away at the foundation of their business.
They did fine, insofar as they're still profitable and well-capitalized, but one has to wonder what things could have been like for them if they hadn't spent the aughties playing Dr Strangelove's Hand with themselves.
OTOH, one could argue that spending a decade eating humble pie was a necessary step in teaching them how to play nice with others.
For sure, I think MS was panicking tbh. They missed the mobile revolution (This was Ballmer and Gates), and then cloud was starting to take off and realized their OS and Office products were not optimized or read for that shift. I think they realized they had to change, and change fast and as a result didn't go well. But at least it started the change we see today with MS (for good or bad).
They were also a couple years late, as for android and iphone had considerable market share.
I think the same can be said for google these days, there is no reason to risk investing time or money into one of their new technologies because it will get dropped if its not one of the big 4 (search, ads, youtube, GCP, maybe arguably android)