How to tell whether an object can follow a path in a specific direction

Godot Version

4.3.stable.mono.official

Question

Hello all, trying to implement custom ghost movement ala PacMan.
Given the current position of a ghost and assuming the maze has all the navigation layer setup correctly,
how can I tell whether the ghost can, indeed, move along a specified direction along the path ?

I want to have a function that tells me whether or not, given any specific direction, like say Vector2.UP if from the current position, the path does indeed allow the ghost to move in that direction.

Is this possible ?