OnCollisionEnter not working

I have 2 spheres with sphere colliders (istrigger is off) controlled by VR controllers, with the root gameobject having a rigidbody on continuous dynamic and isKinematic off, and a cube collider which I'm trying to collide with. The sphere and the cube collide like normal but OnCollisionEnter isn't called.
This is the script: (which is on the gameobject with the collider and I also tried putting it on the root gameobject with the rigidbody)
private void OnCollisionEnter(Collision hit)
{
Debug.Log("collision detected");
}
Contact pairs mode is on all, layers included is on everything, layers are set to default.

Also tried dropping a sphere with a rigidbody onto the cube and it still didn't call

Fixed itself


I also encountered this problem. Although everything worked fine in my game before. Collisions work, but the OnCollisionEnter method is not called. How did you fix this problem?

Take a look at the first chart here. Make sure your objects meet the conditions required to cause a collision message.

https://docs.unity3d.com/Manual/collider-types-interaction.html

Also make sure that collision is enabled on the objects' layers

https://docs.unity3d.com/Manual/LayerBasedCollision.html