Not really a game but Final Fantasy: The Spirits Within was basically the reason Square had to merge with Enix. The film costed so much to make and did so badly that it almost killed them and the merge was the only way they could survive.
It was also the reason Square took a completely different approach to making games from FFX onwards, as the powers that be started taking creative control from the artists working on it and basically became dictators of the development team/s. I once saw an article that said Uematsu was told exactly what songs to make with FF10 and he hated it, I think it was the reason he left Square. But it was all to try and make the money back that they lost.