Yeah, but maybe that's the maximum range when conditions are best. Much of the time, if there's an equipment problem called for in that episode, there's some issue with the planet's atmosphere ("electromagnetic storm" or similar) which causes trouble with the transporters.
"According to The Original Series (TOS) writers' guide, the effective range of a transporter is 40,000 kilometers."
https://en.wikipedia.org/wiki/Transporter_(Star_Trek)