the problem here is that you are not decreasing speed 

you should decrease speed considering the distance of that point you want to get to (the closer it gets the slower it gets) 

and also when reaching the point, the velocity X/Z values should become zero as fast as possible but not immediately

using System.Collections;
using UnityEngine;
using UnityEngine.AI;

namespace UDT.Gameplay.AI
{
    using Player;

    [RequireComponent(typeof(NavMeshAgent))]
    public class UDT_AINPC : MonoBehaviour
    {

        protected NavMeshAgent m_agent;

        protected enum NPCState { Idle, Patrolling, Chasing, Attacking, RunningAway };
        protected NPCState currentState = NPCState.Patrolling;

        [SerializeField] protected Vector3 m_startingPosition;
        [SerializeField] protected UDT_AIArea m_areaOfMovement;
        [SerializeField] protected Transform m_player;
        [SerializeField] protected float m_playerDetectionRange = 10f;

        protected UDT_Player m_playerScript;

        protected virtual void Start()
        {
            m_agent = GetComponent<NavMeshAgent>();
            m_startingPosition = transform.position;
            m_playerScript = m_player.GetComponent<UDT_Player>();

            // Start patrolling
            SetNextPatrolDestination();
        }

        protected virtual void Update()
        {
            HandleState();
        }

        protected virtual void HandleState()
        {
            switch (currentState)
            {
                case NPCState.Patrolling:
                    if (IsPlayerInRange() && m_playerScript.BattleStateStatus)
                    {
                        currentState = NPCState.Chasing;
                        // Optionally notify other guards
                    }
                    else
                    {
                        // Continue patrolling
                        if (!m_agent.pathPending && m_agent.remainingDistance <= m_agent.stoppingDistance)
                        {
                            SetNextPatrolDestination();
                        }
                    }
                    break;

                case NPCState.Chasing:
                    ChasePlayer();
                    if (IsPlayerInAttackRange())
                    {
                        currentState = NPCState.Attacking;
                    }
                    break;

                case NPCState.Attacking:
                    if (!IsPlayerInAttackRange()){
                        currentState = NPCState.Chasing;
                    }
                    break;

                case NPCState.Idle:
                    // Implement Idle behavior if needed
                    break;

                case NPCState.RunningAway:
                    // Implement Running Away behavior if needed
                    break;
            }
        }

        protected bool IsPlayerInRange()
        {
            float distanceSqr = (transform.position - m_player.position).sqrMagnitude;
            return distanceSqr <= Mathf.Pow(m_playerDetectionRange, 2);
        }

        protected virtual bool IsPlayerInAttackRange()
        {
            // To be overridden by derived classes if needed
            return false;
        }

        protected virtual bool IsPlayerInChasingRange()
        {
            // To be overridden by derived classes if needed
            return false;
        }

        protected virtual void ChasePlayer()
        {
            if (m_agent != null && m_agent.isOnNavMesh && m_agent.enabled)
            {
                m_agent.SetDestination(m_player.position);
                Debug.Log($"{gameObject.name} is chasing the player. NOWWWWWWWWWW");
            }
        }

        protected virtual void SetNextPatrolDestination()
        {
            Vector3 newDestination = m_areaOfMovement.GenerateRandomPosition();
            if (newDestination != Vector3.zero)
            {
                m_agent.SetDestination(newDestination);
                Debug.Log($"{gameObject.name} is patrolling to {newDestination}");
            }
            else
            {
                Debug.LogWarning("Generated patrol destination is Vector3.zero. Please check UDT_AIArea settings.");
            }
        }

        protected virtual IEnumerator AttackPlayer()
        {
            yield break;
        }

        protected virtual void ReturnToPatrol()
        {
            currentState = NPCState.Patrolling;
            SetNextPatrolDestination();
            Debug.Log($"{gameObject.name} is returning to patrolling.");
        }
    }
}