They didn't sign Bungie to a deal.
Microsoft already literally owned Bungie, they didn't need a publishing deal.
Bungie bought themselves out from Microsoft in October 2007, shortly after the release of Halo 3, with Microsoft keeping the Halo IP. At that Recon and Reach were in pre-production, so Bungie and Microsoft decided to finish them together, rather than hand them off to another developer. Bungie started building themselves up and working on the pre-production of Destiny in the same time frame.
The development of Halo 2 was difficult by game industry standards, but not really by Bungie standards. Bungie has a long track record of over-reaching, cutting back, and pulling everything out of the fire at the last minute. Same thing happened with Destiny.
Halo 3 and Halo Reach were pretty smooth sailing though.