Windows Phone had a market share so low (~3%) it just didn't make sense to keep pouring money into it when cheap Chinese Android phones were coming in troves and Apple/Samsung dominated the high-end segments.
The Xbox only true competitor is the PlayStation which is much more manageable. Even the first Xbox had a market share of 33% in the US. It's important not to mix up killing a product before its prime and pouring money into an established market for dominance. Windows Phone was the latter.
Cloud gaming (if we believe it will eventually catch on) does not have an established "winner" yet. Nvidia/Xbox/Luna (Amazon) are still trying to make it work and Google had a better approach than all of them with lower controller latency.
What are you talking about lol. Windows mobile was before android and iOS. You’re seriously suffering from survivor bias. There’s was a very obvious path to success with Microsoft and mobile
They put a billion dollars into the refunds of xbox red circled units, nd then sfter that billions more into rnd to make it what it is today. they definitely had a long term vision for it