Besides, the reason "Where No One Has Gone Before" involved the ship leaving the galaxy is because it was loosely based on Diane Duane's 1983 TOS novel The Wounded Sky, in which Kirk's Enterprise tested a revolutionary new stardrive that sent them into ever deeper intergalactic space but damaged the fabric of reality, eventually creating a rift to another universe. So it didn't reflect any master plan on the part of TNG's producers; it reflected the plot of a novel written years before TNG was conceived.
Oh wow, that's right! I remember reading that book years ago, but I never saw the connection until just now. But you are right, it is the same basic story.