Here's where Microsoft went wrong....
Microsoft went wrong long before the phone. To see what ultimately doomed the Windows phone, you have to go waaaaaay back to when Windows first became the desktop king of the world.
Windows wasn't the first graphical desktop and it certainly wasn't the best graphical desktop either, but it finally got one thing going for it that nobody else had - Visual Basic.
For all of it's flaws, Visual Basic (before .Net screwed it up) was a RAD (rapid application development) tool that just about anybody could use to write applications. And write applications they did!
As more and more people bought PCs, more and more of them found that they could write just about any app that they needed with Visual Basic. Not only that, they could sell their VB apps to other people that needed to do the same stuff.
Visual Basic is what built Windows. It is just that simple.
Fast forward to today. Microsoft killed the goose that laid the golden eggs when they replaced VB6 with a bastardized version called VB.Net. (It should have been called VB.NOT.)
VB.Net killed the RAD tool that had helped Microsoft first gain dominance on the desktop. No longer was is it a user friendly syntax with readable code. Nope. Now it was looking more like C# and had lost the readability and ease of use that enticed MILLIONS of people to learn to code in Visual Basic.
In fact, when VB.Net was released, the number of Visual Basic programmers rapidly dropped from over 7 million to less than half that number. And the decline of Visual Basic programmers (both for hobbies/fun and office applications) has only continued to decline.
Now, here comes the next desktop. But what tools do everyday people (the same hobbyist/coders that made Windows a raging success) have to do the same on this new platform? They have nothing. they have nothing akin to the old RAD tool (Visual Basic) with which to code apps for this new platform.
So, Microsoft was stuck with professional programmers. The problem was that all of the pros were already writing apps for Android and Apple, and even they did not want to support a 3rd code base for their apps.
So there was nobody really writing apps for Windows phone, and that's why it failed.
Make something people want to use. Make it easy to use and mold for their own purposes, and your success is virtually guaranteed.
Microsoft has never really seemed to learn this lesson, and I think it will be its ultimate downfall.