2001: A Space Odyssey (1968)
The final script removed this explanation, but it is hinted at when HAL asks David Bowman if Bowman is bothered by the "oddities" and "tight security" surrounding the mission. After Bowman concludes that HAL is dutifully drawing up the "crew psychology report", the computer makes his false prediction of hardware failure. Another hint occurs at the moment of HAL's deactivation when a video reveals the purpose of the mission.
In an interview with Joseph Gelmis in 1969, Kubrick stated that HAL "had an acute emotional crisis because he could not accept evidence of his own fallibility".