Even though the gun is now spinning around its Z-axis (from muzzle flip) and its X-axis (from rifling), the three points of gun, point of ignition, and bullet will always form a straight line (Euclidian straight if there are no other gravitational bodies, or Einsteinian time-space curved if there are), as long as the brass stove-pipes (I think it would, although with a light or no recoil spring, it obviously wouldn't).
If the brass is ejected from the gun, the gun would now get a different trajectory (no longer on the same line as the bullet and point of ignition), as well as slightly change its spin. All objects would now move in straight lines, and the gun, brass, and point of ejection would always form a straight line. Therefore, the bullet, gun, brass, point of ejection and point of ignition would all remain in the same Euclidian plane (discounting gravity).
Since space is not a perfect vacuum (solar wind, etc.), it is likely the objects would eventually fall off their origninal lines and plane, and the brass would eventually stop, then the gun, then the bullet. However, there is too little gravitational attraction between the gun, brass and bullet to ever cause them to be attracted back to each other.
And they'd most likely eventually crash onto another body, or burn up approaching it.
See what happens when you ask a question?