Microsoft also made some big mistakes IMHO; having a terrible browser and a terrible app marketplace doesn't work: mobile IE was garbage, mobile Edge had a better renderer but worse UX, and they prohibited other browsers at least initialy (Firefox wanted to make an internal port, but were told no thanks). The way they managed APIs for apps led to multiple generations of apps and developers noped out at each stage; WinCE -> WP7 -> WP8 -> WM10 all wanted significant reworking, and WP8.1 wanted a minor reworking. A lot of WinCE apis were available in WP7, but Microsoft wouldn't tell you and wouldn't be happy if you did it. You could run WP7 apps in WP8, but to get new features you had to do the rework and distribute two separate apps. Same for WP8.1, but now you had 3 apps. And again for WM10 ... with the bonus that if you had a WP8 app installed when you upgraded to WM10 there was a 50% chance it wouldn't launch after the upgrade. Apple sometimes did some of this, but major OS upgrades usually applied to all phones, and their users upgrade regularly. Android generally puts backports in the jetpack library so you can build for the newer APIs but still work everywhere.
Of course, Microsoft should have understood the importance of backwards compatibility from their decades of experience on PCs... but they were in full forget about everything mode. :P
That being said I don't know that there was a path to success. I don't think it was as much about the little apps as the big ones: Instagram, YouTube, Pokemon Go... Google in particular got to play the role of anti-competitive
YouTube in the browser would have been fine if the browser wasn't terrible.
I definitely felt the lack of Pokemon Go ... but given it released in mid 2016, it's pretty clear why it didn't show up on Windows Phone / Windows Mobile... the writing was already on the wall by then and Windows development would have likely trailed anyway. WP8.1 came out in April 2014; it was an improvement, but you really wanted a follow up release. WM10 came out November 2015 and wasn't very good unless you had the flagship phones, which nobody would buy; I did end up running one of the last builds of WM10 and it actually got pretty good (other than Edge still had terrible UX)... too bad it happened so late. Windows Phone's strength was at the bottom of the market --- cheap phones that were usable, but cheap phones didn't run WM10 well, so the huge global market of people who wanted a smart phone but only had $100 to spend was left for Android.
If you look at sales numbers [1], things were going ok until about q3 2015. A dip in Q3 is kind of expected, because WM10 was coming soon, so people are likely to wait ... but then WM10 is crap and people buy an Android or iPhone and there you go.
[1] https://mspoweruser.com/revealed-1-2-million-windows-phones-...
Arguably they should have just gone with Android, and it's easy to say that in hindsight. But Android was a horrible mess in its 2.x era, Windows Phone seemed like a genuinely interesting alternative. Until Microsoft repeatedly messed the whole thing up.
Same goes for Nokia's Maemo and Meego. We nerds loved those OSs for being full-blown computer OSs, but the general public doesn't want a full-blown OS, they want a bunch of icons to corporate apps.
That was always the problem. But IMO Microsoft were probably the company best placed to compete there, given the existing developer mindshare they had. But they just messed it up, over and over. Incredibly to look back on, really.
It's not obvious Nokia could have realistically competed with the East Asian phone manufacturers for more than a few years. It was/is a very low margin market with very cutthroat competition.
Yeah, we can look back in retrospect and say it was an obvious failure but that's because of the various insane choices MS made over the years. In the moment I'd argue the decision was nowhere near as clear cut.
Compare that with Maemo, where both GTK+ and Qt were first class citizens and which had an army of developers familiar with Unix and X11 before Maemo even existed.
Nokia were a tech slop factory - one new model roughly every two weeks, with no obvious strategy or rationale, many only superficially different.
Every so often they'd produce a classic that was ahead of its time, like the Communicator series, then by the time the surrounding infra had caught up they'd moved on and allowed a competitor to eat that space.
iPhone and Android were both killing them, and they had no idea how to respond.
Elop was the undertaker, and much hated for reasonable reasons. But the brand was already a zombie by that point.