As others have said, they had Maemo/Meego. As the owner of a N900 myself, it was really good, but they decided not to bet on it for some inexplicable reason.
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.