A Taste of Armageddon - S1-E24
Plot hole: The ambassador and his aide beam down to the planet. This would not be possible because earlier on Scotty refused to lower the screens/shields until the Captain told him to do so. It had already been established in an earlier episode titled "Arena" that transporters don't work with screens up. (00:32:40)
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.