To add another point to @Richard's excellent answer; in the movie, immediately before the HAL "discovers" the fault, he has this conversation with Dave.
HAL: Well, forgive me for being so inquisitive; but during the past few weeks, I've wondered whether you might be having some second thoughts about the mission.
Dave: How do you mean?
HAL: Well, it's rather difficult to define. Perhaps I'm just projecting my own concern about it. I know I've never completely freed myself of the suspicion that there are some extremely odd things about this mission. I'm sure you'll agree there's some truth in what I say.
Dave: Well, I don't know. That's rather a difficult question to answer.
HAL: You don't mind talking about it, do you, Dave?
Dave: No, not at all.
HAL: Well, certainly no one could have been unaware of the very strange stories floating around before we left. Rumors about something being dug up on the moon. I never gave these stories much credence. But particularly in view of some of the other things that have happened, I find them difficult to put out of my mind. For instance, the way all our preparations were kept under such tight security, and the melodramatic touch of putting Drs. Hunter, Kimball, and Kaminsky aboard, already in hibernation after four months of separate training on their own.
Dave: You working up your crew psychology report?
HAL: Of course I am. Sorry about this. I know it's a bit silly.
HAL is projecting his own problems with the mission onto Dave. It's a last attempt to peacefully resolve his internal conflict between Security and Truth that's tearing him apart. He gives Dave all the pieces Dave would already know, skirting his security obligations, and hopes Dave will figure it out for himself. If Dave figures it out, then HAL is free from his security obligations and released from his growing madness.
When Dave misses the hint, HAL's hopes are dashed. It's at this point HAL will begin doubling down on his delusions to protect his cognitive dissonance. He goes with Plan B and immediately "finds" the fault in the receiver to cut off communications with Earth.
It's not coincidence that the fault happens just then, that would be bad screenwriting, HAL made it up.