One of the first things the alien leader says, and kudos to Star Trek for recognizing this, is that Andromeda is so far that modifications to the ship will need to be made to enable it to travel fast enough to reach our neighbor in 300 years -- this means the ship would be traveling at something like 10 thousand times the speed of light.
But the scene in which The Enterprise went through the barrier at the edge of the galaxy shows that even the Kelvans looked concerned about succeeding in this. Does this imply that even with Kelvans modifications getting out of the galaxy is dicey or that the Kelvans had not made such modifications?
I recall at least one other episode mentions the barrier and in real life, I think one of our probes, I guess Voyager, encountered a region of very high temperature as it was going through some very distant point in the Solar system. (Was anything known about this region in the 1960s? If not, quite remarkable that Star Trek somehow sort of predicted this.)