# Aligning to quaternions in different coordinate frames

I am trying to compute the rotation quaternion between two quaternions called, q_IMU and q_VZ.

I am computing the rotating quaternion by the method seen in the first equation at a maxima for both quaternions (so they are aligned)

$$^{S}_{E}q_{est,IMU} = q_{E} \otimes ^{C}_{M}q_{est,VZ}$$

Then I want to align the other measurements of q_VZ onto the reference plane for the IMU via:

$$q_{E} = ^{S}_{E}q_{est,IMU} \otimes {^{C}_{M}q^{-1}_{est,VZ}}$$

This works for one of my measurements but not for this one I've added pictures. q_IMU, q_VZ before rot, q_VZ after rot

Can somebody explain why they are not aligned using this method, because I don't understand?