Maybe there is confusion because control problem and rendering problem are mixed in the same thread, i don't see any relation between them.
misho wrote:Is it possible for you to write the force and torque callback you were mentioning? I am still working on the proper rotation order for my space simulator, and I just want to make sure I am not observing any undesirable effects from applying torques on principal local axis.
This indicates you want a better control now just to help solving the render problem?
That's just anather layer of indirection again - you MUST solve the problem at it's root. Now. Control comes after that.
Controlling a body with forces (or torques) will make it rotate around drifting axis,
controlling with velocity is better but the same problem.
Setting it's orientation matrix directly is what you want - you have full control over any axis of rotation.
To do this, you would calculate its orienation with euler to matrix code like i gave, use the same eulers for the renderer and try all options until they match. I than can create the reverse transform for you.
If you wan't to remove another layer of indirection, you could work without any physics body at all and use the just the orientation matrix alone.
At this point we would be exactly at the code i gave before

You say you 'struggle' with it, but that's too less information to help further.