Cubes deforming when rotated

Hi, I’m making rubik’s cube. Problem is when I select nine cubes and rotate them (in object mode, select nine cubes and rotate around the centre of the whole cube, pivot point) the cube’s deform. They get smaller toward the pivot point and then expand. Appears form the second rotation. What is it I’m doing wrong? Any suggestions.
I can’t attach my blender-file. It seem to be too large.