Factual error: Trelane has been watching Earth as it was 900 years ago (14th century in the film), but his style is more 17th century, and he mentions Napoleon who lived in the 19th century.
Factual error: The harpsichord Trelane plays is far too short and has pedals like a piano.
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.