It looks like flee is trying to set a destination that it outside the navmesh and because the agent hasn't moved the task will return failure. As an enhancement you could add something similar to the Wander task where it first checks the navmesh with SamplePosition and only sets the flee destination if it is valid.