Having issues disabling pathfinding when object is being knocked away from the enemy

How can I disable A* Pathfinding so I can apply force to the object? I tried doing a simple test script, but the pathfinding remains enabled, not sure what I’m missing or if there is simple logic to disable pathfinding on the object indefinitely.

The scenario should be, Enemyobject moves towards player, if the player presses mouse click 0, the enemy is knocked away from the player’s direction. It just stops moving currently, even when the force is being applied.

using UnityEngine;
using Pathfinding;

public class EnemyTestController : MonoBehaviour
{
    private IAstarAI astarAI;
    private Rigidbody2D rb;

    // Threshold to detect a significant change in velocity, indicating a knockback
    public float knockbackVelocityThreshold = 5f;

    void Start()
    {
        astarAI = GetComponent<IAstarAI>();
        rb = GetComponent<Rigidbody2D>();
        Debug.Log($"{gameObject.name} Pathfinding initially active: {!astarAI.isStopped}");
    }

    void Update()
    {
        // Check if the enemy has been knocked back
        if (rb.velocity.magnitude > knockbackVelocityThreshold)
        {
            DisablePathfinding();
        }
        Debug.Log($"{gameObject.name} Pathfinding active: {!astarAI.isStopped}, Velocity: {rb.velocity}");
    }

    private void DisablePathfinding()
    {
        if (astarAI != null && !astarAI.isStopped)
        {
            astarAI.isStopped = true;
            Debug.Log($"{gameObject.name}'s pathfinding has been disabled due to knockback.");
        }
    }

    // Optional: Method to re-enable pathfinding, if needed in the future
    public void EnablePathfinding()
    {
        if (astarAI != null)
        {
            astarAI.isStopped = false;
            Debug.Log($"{gameObject.name}'s pathfinding has been re-enabled.");
        }
    }
}