2d rigidbody falling from the collider when it is moved

I have a box made of four rectangles. A 2D box collider is attached to each of the square. The box rotates in both the directions upon receiving the commands. The square inside the box has a rigidbody attached to it. The square rests on the box when pressed play however when I am rotating the box, the square jumps down the box and keep going down. Please suggest a resolution for it. Below is a screenshot.

After rotating the box

@shakti_patra You will probably need to add a single collider to each of the rectangles that form the big square because if you put a single collider, it will fall.
I think this is the solution, tell me if it works :slight_smile:

Thank you for the response however I am already using individual 2D box colliders for the sides and facing this issue. I also tried using single polygon collider however still facing the same issue. I tried decreasing the rotation speed of the box and issue was fixed but my game requires high rotation speed. Any help is highly appreciated…

I know this is a necropost but I had this issue and found a solution. Give it both a box collider and a slightly smaller circle collider. Due to how circle colliders work they almost never fall through other colliders. Making it slightly smaller also means the box collider behaviour gets priority.