There was a passing reference to this in the short story "Visit to a Weird Planet Revisited," from one of those New Voyages
Shatner, Nimoy, and Kelley are accidentally transported from the studio set to the real Enterprise
and they have to pose as their real-life counterparts for a while. There's a scene where Kelley takes up his usual position on the bridge "wondering, not for the first time, whether the doctor had any business there." Or words to that effect.