Ball falls through the floor... why?

I have a scene where there is a box and a ball inside it, both have rigid bodies and physic materials. The ball is launched inside the box at a random angle and speed, so the ball bounces around until it finally stops. Everything works fine… but not always. Sometimes the ball falls through the floor o passes through the walls… the problem seemed to be solved when I increased the mass of the box to 1000k but after some more testing it was clear that such change didn’t solve anything…

Inside the box there is also an object with an script that modifies the speed and direction of the ball when it gets hit, but the problem doesn’t seem to happen immediately after the ball hits this object… I’m not quite sure but it seems like the ball become invisible to the collision system immediately after hitting the ceiling… but again… not always.

I’m new to Unity so maybe I’m missing something… but I just can’t figure out what… can anyone help?

How fast is the ball moving? If it’s moving too quickly, it could pass through the walls and floor without actually hitting the colliders. Check the speed it’s moving when it slips through, and possibly increase the solver, sometimes that’ll help.

Edit>Project Settings>Physics>Solver Iteration Count