EnterOnTrigger2D() stops detecting when colliders get too close to each other

Ive added a feature/functionality to my enemy script where i intend to make it so that if an enemies sensors(invincible gameobject with Collider2D) collides with a enemy object and its not the enemy that’s the closest to the player it will stop moving until the enemy in front moves again.

'It works fine most of the time, but if i with the player push the enemies into each other and let them move the void OnTriggerEnter2D and OntriggerExit2D stops working entirely.

It seems like when they’re to close to each other the collision has to be reset by them exiting each other colliders and re entering. I don’t know how to fix this and been stuck on it for a very long time.

down below i have the part of the script that is of interest and then below the entire enemy script

of importance:

//sense if sensor has been triggered
void OnTriggerEnter2D(Collider2D col)
{
    //check if the collisio was a player
    if(col.gameObject.CompareTag("Player"))
    {
        //tell the enmy which sensor was triggered
        enemyScript.sensorTriggered = sensorPlacement;
        if(!enemyScript.isAttacking && enemyScript.attackCooldownTimer >= enemyScript.attackCooldown)
        {
            //start the punchattack ienmumerator in enemy script
            enemyScript.StartCoroutine("PunchAttack");
            enemyScript.isAttacking = true;
        }

        //disable and enable collider quickly to make it work again so it doesnt deyecy twice
        gameObject.GetComponent<Collider2D>().enabled = false;
        gameObject.GetComponent<Collider2D>().enabled = true;
    } else if(col.gameObject.CompareTag("Enemy"))
    {
        //if the enemy is behind another enemy moving towards the playeer it will stop
        if(sensorPlacement == directionPlayerIsIn)
        {
            enemyScript.isMove = false;
        }
    } 
}

void OnTriggerExit2D(Collider2D other)
{
    if(other.gameObject.CompareTag("Enemy") && !enemyScript.isAttacking) //if exiting collider is enemy make it so that gameobject can move
    {
        enemyScript.isMove = true;        
    }
}

WholeScript:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SensorScript : MonoBehaviour
{
    public string sensorPlacement;
    private NormalEnemyScript enemyScript;
    private string directionPlayerIsIn;

    // Start is called before the first frame update
    void Start()
    {
        //define the enemy script variable
        enemyScript = gameObject.GetComponentInParent<NormalEnemyScript>();
    }

    void Update()
    {
        //check if the player is to the left or the right of the enemy to determine if its moving towards or from the enemy the sensors collided with
        if(GameObject.Find("Player").GetComponent<Transform>().position.x > enemyScript.GetComponentInParent<Transform>().position.x)
        {
            directionPlayerIsIn = "Right";
        }else if(GameObject.Find("Player").GetComponent<Transform>().position.x < enemyScript.GetComponentInParent<Transform>().position.x)
        {
            directionPlayerIsIn = "Left";
        }   
    }

    //sense if sensor has been triggered
    void OnTriggerEnter2D(Collider2D col)
    {
        //check if the collisio was a player
        if(col.gameObject.CompareTag("Player"))
        {
            //tell the enmy which sensor was triggered
            enemyScript.sensorTriggered = sensorPlacement;
            if(!enemyScript.isAttacking && enemyScript.attackCooldownTimer >= enemyScript.attackCooldown)
            {
                //start the punchattack ienmumerator in enemy script
                enemyScript.StartCoroutine("PunchAttack");
                enemyScript.isAttacking = true;
            }

            //disable and enable collider quickly to make it work again so it doesnt deyecy twice
            gameObject.GetComponent<Collider2D>().enabled = false;
            gameObject.GetComponent<Collider2D>().enabled = true;
        } else if(col.gameObject.CompareTag("Enemy"))
        {
            //if the enemy is behind another enemy moving towards the playeer it will stop
            if(sensorPlacement == directionPlayerIsIn)
            {
                enemyScript.isMove = false;
            }
        } 
    }

    void OnTriggerExit2D(Collider2D other)
    {
        if(other.gameObject.CompareTag("Enemy") && !enemyScript.isAttacking) //if exiting collider is enemy make it so that gameobject can move
        {
            enemyScript.isMove = true;        
        }
    }
}