Nokia didn't go with Windows Mobile because it thought it was the superior platform. It went with a different platform because it had become painfully clear to said middle management that Symbian could not be economically technically adapted for modern smartphone hardware, that sales were tanking as a result. And then Nokia went with Microsoft instead of Android because Microsoft gave them a boat load of money to do so, whereas with Android, Nokia would've had to build everything from scratch, and it wasn't clear anymore that they'd have the resources to do so.
Nokia's story is, more than anything else, of how technical debt can kill a company.
This is like them releasing an 8bit console with no games and just as expensive. In 1988, when everyone already owned a Nintendo or Sega.
It was stupid, and also the final fatal mistake that Nokia made. It was clear Android was well on its way to become the "Windows" of smartphones, which meant, ironically, that WP would be relegated to being at best the macOS or Linux of the mobile market. Plus, Android already allowed OEMs to be "different".
Nokia was basically making an argument for a "different ecosystem" at that point. But they should've known that it was too late to attract developers to a third ecosystem. Android had to fight hard to even reach more or less parity with the iOS ecosystem in terms of revenue for developers, even with its 5x larger market share. There was no hope WP would win in these conditions.