Pilots are prepared to cope with a range of emergency scenarios, but failures in training can lead to catastrophe in the cockpit.