The N9 shipped when it did because the teams working on the successor project had been pulled back to support the N9, and Elop arrived to find a company betting its future on a new platform that had almost no existing third party support and which wouldn't have any follow-up hardware for another 2 years. Google has no incentive to work with Nokia rather than the existing vendors who'd staked themselves to Android, the other competing platforms at the time were basically all tied to a single vendor, but Microsoft wanted a recognisable brand name and would throw engineering resources at supporting them. With hindsight it obviously didn't work, but Meego as a competitive platform was already dead even without heading in the Microsoft direction.
It's funny that these conversations always focus on Elop and not all the decisions already made by the time he showed up. Maemo bring rebased on Qt at the insistence of the Series 60 team so there could be a transition story from S60 to Linux delayed software development significantly, and the merge with Moblin was ultimately entirely unnecessary churn.
It's a convenient story to blame Nokia's failure on Elop and Microsoft, but in the timeline where that transition didn't happen we'd still look back at the N9 as the last gasp of a giant that failed to adapt to the changing market fast enough. The N9 came out almost 4 years after the iPhone - the Pre had landed two years earlier and even so had failed to gain sufficient market support to survive, and HP killed WebOS a few months after the N9 shipped. In 2011 momentum was entirely with iOS and Android. If the N9 had shipped in 2009 they might have had a chance. Instead, the N900 was shipped in limited company quantities with woefully uncompetitive hardware.
It's 2011. Faced with an ecosystem that has changed massively in the past 4 years that's destroyed your high end market and is threatening your medium and low end market, and given the choice between an (absolutely beautiful!) in-house platform with no killer apps and two years before you can ship a successor, and the opportunity to tie up with a dominant OS vendor who'll prioritise your brand and provide engineering support and make it possible to churn out several new high end devices in that two year timeframe, which seems like the better choice?