It was in the Day of the Dove where they brought up the idea of intraship beaming. It’s a dangerous and risky procedure as precision was necessary. You might end up in a bulkhead. I’m sure it was a simple writer’s trick to raise the suspense. They beamed onto other ships directly to the bridge without trouble for example, The Tholian Web, IIRC.