Windows Phone was mostly sabotaged by first-party developers. Microsoft has a history of abandoning their mobile phone OSes after very short periods of time and nobody trusted them not to do it again. As a result few app developers bought into the ecosystem and smartphone enthusiasts told their friends not to get Windows phones, causing modest sales, causing Microsoft to immediately drop the platform.