One possible reason is that there is no path to the nearest enemy.
I suggest adding logging to your events - for example in the first event on your screenshot add this action:
Browser Log "Finding path to enemy UID:" & enemy.uid
Add another event "On Failed to find path" with another Browser Log message.
Then run the project in debug mode, open console and check the enemy UID. Find this enemy by UID, zoom out the layout, see if it's blocked in solid objects etc.