Pacing is important, but in a location-based game, I would suggest that (1) the DM should not have location Y as an option if it is not sufficiently prepared and (2) it's exceedingly easy to end on a cliffhanger or other suitable endpoint without changing a thing. If the DM cannot, then that's a problem with the game design. To build on your random encounter example, if one is indicated, describe a compelling scene brimming with excitement, then say "To Be Continued."
What does "sufficiently prepared" mean in this context? In my example I was assuming it was fully prepared, but the party elected to travel there other that at the beginning of a session.
An occasional cliffhanger can work, but that will throw off pacing for the next
session, so you're just kicking the can down the road. Also, anything more than an occasional cliffhanger makes it problematic to run an episodic campaign (something that location-based games can otherwise excel at).
As an aside, this is just my own preferences/biases showing, but I'm hard-pressed to imagine a random encounter ever being "compelling".
By virtue of the fact that it was random I already know that these are opponents who either didn't exist until the dice were rolled, or would have been somewhere else had the dice come up showing another number. I also know that if the DM isn't allowed to change unseen setting elements to weave in the random encounter, the encounter can't
matter other than as a threat of death or lost resources. If a DM ended a session with a cliffhanger made from a random encounter I would not
be particularly looking forward to the chore of fighting it the next week. But that's just me--my strong dislike of random encounters is very idiosyncratic.
I am somewhat surprised, though, that those who hate the idea of (e.g.) the DM adding/moving/removing an extra slime from a dungeon (for any reason) are totally fine with letting the dice add an extra slime in the form of a random encounter. But that's probably because they're looking at it through an "authenticity of the challenge" lens whereas I'm looking at it from the point of view of verisimilitude.