Rotation along one axis does not work
As binweg found in another post, the problem has been the Euler Rotation.
I changed the rotation of every cube to Quaternion and everything worked as it was meant to be.