Link to bug report: https://developer.blender.org/T57313
It seems that in a keyframed bone after the fcurve is evaluated the resulting quaternion is not unit normalized, so when applying the relax operation the quat. interpolation fails.
I was not sure if the quaternion should be normalized when the bone is evaluated (I couldn't find where this happens anyway), but I decided to just normalize (the copy rather than the stored value) before interpolation.