How do I disable ONLY the component of a child object and not the parent?

I have a puzzle piece that I move by dragging with the mouse
Th puzzle piece is made of a parente gameObject witha collider2D an other things(collider used for dragging) and two, three or four child gameObjects that have each a collider2D(these work as the teeth that a puzzle piece has to assemble with another piece)

While I drag it I want to disable the collider from all the child game objects so that only the piece collider can collide with the another piece´s teeth

But when I run my code all of the colliders, including the parent gameObject collider, get disabled and get this error:

NullReferenceException: Object reference not set to an instance of an object

This is the part of the script in the parent gameObject that is supposed to make it happen(disaable only the colliders in children):

‘’’
GameObject children;

void Start()
{
    children = gameObject.GetComponentsInChildren<GameObject>();
}

private void Update () {

...

        foreach (GameObject collider in children)
        {
            collider.GetComponent<Collider2D>().enabled = false;
            Debug.Log("Hijo desactivado:" + collider.gameObject.name);
        }

...

    }

How do I disable ONLY the component of a child object and not the parent?

This won’t work, because a gameobject is not a component.