As much as I understand and appreciate the attempt at rationalizing a silly point in the script, the dialogue is pretty clear that the Great Barrier is located at the center of the galaxy and Sha Ka Ree lies beyond the barrier. Actually, the Enterprise isn't the only attempt at traversing the barrier. Kirk indicates that "no probe has ever returned."
Maybe, like the (likely non-canon) Star Trek: Star Charts book indicates, the Great Barrier is a spherical energy field engulfing the whole galactic core and all the stars within. The diameter of the Great Barrier is approximately 15,000 light years. Sha Ka Ree is not depicted to be at the center of the galaxy. Instead, it is at the outer edges of the energy field, some 7,000 light years away from the actual center.
That could work a little better perhaps. And, perhaps the crew was in the brig for a few days that were not shown "on screen."