Game crashes when 3 gameobjects collide at the same time.

So I made a game where enemies follow you but I decided to teleport them away whenever they collide with eachother but when 3 enemies collide at the same time the game crashes.

void OnControllerColliderHit(ControllerColliderHit hit){   
//part that does a game over, don't think is relevant
        if (hit.gameObject.tag == "Player"){
            StartCoroutine(hit.gameObject.GetComponent<MoveForward>().callDeath());
        }
//part that teleports the enemies away
        if (hit.gameObject.tag == "enemy_strong"){
                Vector3 NewSpawnPos = new Vector3(characterController.transform.position.z + 30, -0.78f, characterController.transform.position.x +30);
                characterController.Move(NewSpawnPos);  
            }
        }

Does it give you any error before crashing? Maybe try stack trace or check the crash log files to see whats causing the game crash

This code:

if (hit.gameObject.tag == "enemy_strong")
{
                 Vector3 NewSpawnPos = new Vector3(characterController.transform.position.z + 30, -0.78f, characterController.transform.position.x +30);
                 characterController.Move(NewSpawnPos);  
}

might cause a stack overflow, since characterController.Move doesn’t move the enemy to the new spawn point instantly. It only moves it a small amount in a direction. Therefore they collide again, calling the same code infinitely until your stack crashes.

There’s no errors. And there seems to be a crash folder but nothing in it, there’s also only one while the game crashed multiple times. Also the crash seems to happen when there’s multiple enemies colliding
and they teleport. I think this is a genuine unity bug, because it happens when the game handles two collisions in the same frame.