And that's fine, as far as I'm concerned. When I have characters flee... I let the player tell me where their character runs off to. They have the description of the area... they know the narrative conceit of what "fleeing" is, so they know how their character is behaving in that situation... so they can tell me where their PC is fleeing to get as far away from the spellcaster as quickly and as far as possible (same way if they had to run off following a fear effect). And if the direction they chose sends them into a hazard they did not know about or see (like a pit trap or quicksand as you suggested)... then they will suffer the results. That's fine. I will interpret the ruling for that situation if and when it comes up.
At the end of the day like I said... just have the character react like they were in a movie and saw Jason Vorhees or something-- they don't run in singular a straight line tripping over or running smack dab into every single thing in that path like they were Wile E. Coyote or something... they move around things to get away like any normal person would. But at the same time, if there were things they didn't notice as they were running, they'd perhaps trip on one (and that's where within the game I'd call for maybe a Perception or Acrobatics check to try avoiding.)