I saw this article in the Harvard Business Review that goes into some of the business / corporate reasons why Boeing and the 787 find themselves where they are. One can see how the design strategy used by Boeing on the 787 could result in parts the "didn't all fit together". One can also see how Boeing might have known about the issues with the battery but decided to take a mitigate now, fix later approach. I guess the only fly in that ointment is that they couldn't mitigate fast enough.
The 787's Problems Run Deeper Than Outsourcing - James Allworth - Harvard Business Review