If you want, you can try too fix it because I can't figure it out... :<
Why no woooooorrrrkkkk I added two beams for the balls to bounce off of. (DON'T) and it should be impossible for them to get stuck outside of the box but they can phase through the obstacles... :<