This is something we can't know. I'm starting to feel we aren't getting enough information here to know much of anything really, but isn't it great that we have so much to chew over, confusing though it is?If the ship were simply sitting in intergalactic space outside out galaxy, then navigating back would pose no problem in of itself.
----------------------
Your post gets me wondering... do they mention the galactic Barrier? I really only acknowledge the unremastered original, not the one that eliminated that amazing Barrier effect in favor of an excessively literal and nitpicky interpretation of the dialogue that they seemed to think conflicted with what was onscreen, even though the ep was made by responsible adults who know their Trek.... For me, since in the original it LOOKS like the galactic Barrier they're stuck in, it IS. Slips of tongues happen.
------------------------
I think a brief mention of the Barrier does happen, and is part of the dialogue that caused the remasterers to show the Ent punching through it in a nanosecond, only to appear in a boring secondary "void" with some purple clouds in it, instead.
--------------------------
You made me wonder if it doesn't have to be the galactic Barrier at ALL. If they don't say they're heading out of the "galaxy" but instead the "universe" or the "space time continuum" or whatever....?
--------------------------
Could they have been scatter-brained enough to reuse the Barrier effect (in the original) for a completely different place? How would they get to some other universe though, just by a couple minutes of fast driving?
---------------------------
I always thought it made enough sense that they were leaving the galaxy yet still lost IN the Barrier.and that it could be so vast on impulse that getting stuck meant having no way to direct the ship out, and if you picked the wrong direction you might go so far in a wrong direction you might end up hopelessly deep into it. At warp you could make a much bigger mistake. It could have spatial peculiarities making it a world and void unto itself unless you know just how to cross in the "narrowest" direction.