Pitch Rotation stucks at [-90 90] C++

The problem is happening on the “poles”, ill try to add the branch code for the poles and see what will happen.