They botched the original Windows Phone through a failure of managementThis. I had some Windows Phones besides my iPhones, because I liked very much what they were doing. Windows Phone 7, despite being technically weak (it was based on Windows CE), had an awesome UI. Nokia had some really affordable phones that were really well-built for the price and Windows Phone was getting traction. Quite a few friends/colleagues bought a Windows Phone, because it was the hip thing after the iPhone. The development story was also great, they used .NET and XAML (IIRC), which also made it possible to demo applications on web pages through Silverlight.
Then they screwed over all the early adopters by completely deprecating Windows Phone 7, doing one final release (7.8). None of the Windows Phone 7 devices were upgraded to Windows Phone 8. Most of the traction they had up till that point was lost and they were basically starting over with Windows Phone 8. Windows Phone 7 was already late to the market, the hard WP8 cut set them back even more years. And then it was simply too late.
There were technical reasons for WP7 -> WP8 (such as moving to the NT kernel, adding multi-processing support). But the hard cut was a catastrophical mistake. Either they should have started with the NT kernel in the first release or they should have had a gradual migration route from WP7 to WP8.