The pitch rotation you created is a 30 deg rotation about the X axis. However, a pitch rotation is, by definition, a rotation about the Y axis. I think you are not understanding the concept of coordinate frame transformations and Euler angle representation.
Euler angles are only one way to represent a transformation between two reference frames in a more geometric visualization, with the caveat that we might encounter some singularities.
Hence, first you need to obtain the DCM (or quaternion) that rotates one reference frame into alignment with the other. After that, the Euler angle representation (yaw, pitch, and roll) of such a rotation is obtained by dcm_to_angle(D, :ZYX).