I don’t know, but it looks like you have issues between world- and local space.
A capsule’s Y-axis is normally along what you currently see as the X-axis. I believe you are showing the world-space gizmo, but the code is working in local-space. I don’t know what the ‘Thrust’ code looks like, so I cannot give you more info/help than this.
I think what you could do is to make the capsule a child of another empty, and put the code on the empty. Then rotate only the capsule to the rotation you want. This should keep the new empty’s local rotation as needed, while displaying your capsule like you want it