The Ultimate Computer - S2-E24
Plot hole: When M-5 destroys the ore freighter, Dr. Daystrom says, "Fortunately, it was only a robot ship." But Daystrom wasn't on the bridge yet when Spock announced that fact. He didn't have any way of knowing that the freighter was unmanned. (00:23:00 - 00:25:05)
Answer: Kirk was getting his physical and Dr. McCoy probably turned off communications, because if he hadn't, Kirk would have left and headed straight for the bridge, leaving McCoy irritated.