A routine takeoff turned into a near-disaster after pilots made a computer error that slowed the aircraft’s climb.