easy way to avoid this is to change direction of jet immediately after firing bullets
Air resistance + accelerating fighter aircraft. Same thing happened to an F-11 tiger.
https://www.popularmechanics.com/military/aviation/a27967/the-fighter-plane-that-shot-itself-down/