Child GameObject does not rotate with the collider

Im fairly new to unity and coding, but I’m having a problem where a cube gameObject I made as a child, does not rotate in sync with the box collider. If I keep it at a 90 degree angle it all lines up perfectly, but if I Rotate it so make a slanted surface, the collider does not move perfectly with the object itself. If I make it its own GameObject and not a child, I don’t get this problem, but for some reason, as a child, it has these problems. I would like to know how to fix this.