I read an article recently that in part was asking the question, "why is software so hard?" They were using the statistics that 1/3 - 2/3 of all projects are late, over budget or canceled. Whether this is really any different in other industries is another article.
One of the reasons software is hard is that it depends on many individual parts from multiple development teams from multiple vendors. Since each of these parts has differing levels of quality, robustness, and other non-functional type attributes the product your team is putting together has to account for these differences, most of which are unknown at the time your received them. Additionally vendors release patches for various reasons that change these attributes in subtle and not so subtle ways.
One third party vendor we deal with releases patches on a monthly basis. However, from time to time they (usually unintentionally) change the API signatures. As an integrator of this product these kinds of changes cause no end of debugging and explanations to management why things are broken, or can't go forward.
Multiply this times the number of vendors you use and the varity of changes that can be made and you have a recipie for schedule deviations and cost variances. It is no wonder some companies prefer to build vs. buy.
How do we fix this? No easy answers really. Some pundits call for holding vendors accountable, but how? We already do to some extent by continuing to buy their products or not. Another solution batted about is some kind of quality standard, but the realities and costs of such a standard are not realistic.
Probably the most realistic way is for each company/team to take responsibility on themselves to produce high quality software through whatever means are appropiate for them and to communicate with your clients about the realities of your product.