It works perfectly fine, you’re doing something else wrong here as this is such a basic thing to do.
When you disable a collider, what you’re actually doing is removing everything from the physics-side of things. It won’t continue to work, there’s nothing there.
Note that one of the colliders cannot be disabled and you’ll see that there’s no disable check-box in the inspector; that’s the CompositeCollider2D.
If you run the code above, you’ll see the colliders have their check-box unchecked but if not, your code isn’t running or isn’t working on the correct thing. Note that if you look at any of the collider in question in the inspector and open the “Info” foldout, you’ll see how many shapes it has created. A disabled collider will always have zero shapes in the physics engine.
Also, your code doesn’t really make sense. If you deactivate the GameObject, everything is disabled anyway so what’s the point in explicitly disabling the colliders?
All of the above comments assume you’ve debugged this before coming to the forums to check it’s running and working on the correct things. I presume you’ve done this.
BTW, here’s how to post code on the forums: Using code tags properly