OnCollisionEnter2D does not call sometimes

I have 10 different prefab and they falling down. When they hit collider, they will be destroy. OnCollisionEnter2D function they do not only destroy some of statement in this function. These prefabs are destroy but other statements does not run like Debug.Log(“test”);

Don’t Destroy an object during a collision. Instead, create a “DestroyMe” Boolean flag, set it to true on the collision, and then when it’s true Destroy the object in Update.

This is because, if you DO destroy an object with a collider during a collision, other OnCollisionEnter2D events for that same collision will not get called (as the collider no longer exists). And since the order of calls is arbitrary, you get inconsistent results.