NavMesh Agent weird behavior

I have been trying for days to get this movement to work and I can’t figure out the problem. I want the enemy to wander forward for a distance at the moment, but when I try to apply the transform.forward, instead of moving along the z-axis as it should, it starts drifting off in a backward diagonal direction.

public class ZombiePathfinding : MonoBehaviour
{
    public Animator animator;
    public NavMeshAgent agent;

    private Vector3 target;
    private float timeLeft = 5.0f;

    void Awake()
    {
        agent = GetComponent<NavMeshAgent>();
        animator = GetComponentInChildren<Animator>();
    }
    void Update()
    {
        timeLeft -= Time.deltaTime;

        if (timeLeft < 0)
        {
            agent.SetDestination(transform.forward);
        }
    }
}

Any ideas on what could be going wrong?

Transform.forward is 0,0,1 with respect to the direction of the agent.
So if you are in front of this global coordinate by more than 1 unit, when you set the destination it will try to find it’s way backwards to 0,0,1.