You're absolutely right, sorry. I understand the proof through the dot product, I had forgotten the quaternions were unitary.
It seems my derivatives are correct at least in direction, as I get inner products which are either 0, or in the order of 10-19 and 10-20, which can be considered...