See it for yourself
You and the machine share one rule: always move to whichever cell looks closest to G.
You go first. Then it's the machine's turn.
In maze 1, the rule works. In maze 2, watch what happens when an unseen trap blocks the obvious path.