It is tempting to conclude that the lesson here is to get your lawyers involved early and often in order to come up with iron-clad contracts that simply cannot go wrong. While early legal work may be a good investment, it is not entirely realistic to think it can avoid all problems. If the basis of understanding is flawed, no contract will improve it. Rather than focusing on the contract as a legal instrument, turn your attention to the understanding at the heart of it. When parties develop a real commonality of interest, all is possible.
Litigation becomes less likely and success more likely.
The project may not go smoothly from beginning to end, but it will tend to respond constructively to the problems it encounters and have the best chance of delivering a useful and effective system. The best rule is to think of a contract as bad if one party can win while the other loses. This is the kind of contract you must avoid, even if your organization is the putative winner. But this sounds crazy. Too often it is, but such contracts usually turn out badly.