Parenting bones issue folding a package
Classic case of gimbal lock.
If you rotate the middle axis 90 degrees, the two other axes will be aligned thus reducing the degrees of freedom to two.

To fix the problem, you can either change the rotation order or use quaternions.