Collision Settings for Hidden Objects

I'm creating a scene that uses JavaScript to toggle the visibility of objects.
Collision settings remain on hidden objects.
This hasn't happened before.
What should I do?

Could you share a link to the scene with us, so we could take a closer look at the issue?