Looks like your code might be behaving differently depending on the time difference between two frames (DeltaTime). When you right-click, the game stops updating, and when you close the context menu, the game simulates a frame with a large DeltaTime to make up for the passage of time. If your code isn’t written to take this into account, you might see weird behavior.
Consider the following :
Since it looks like you are spawning bullets periodically in some time interval (e.g. 0.1s), when the game stutters and the frame takes 1s, will your code spawn 10 bullets to compensate? Or just 1?
If you spawn 10, since they’re spawned on the same frame, will they be spawned in the same location?
It looks like in the above scenario you are spawning 1 bullet, and the other bullets are moved forward by a large amount to compensate for the time passage, hence the space.
Make a build of your game and try running on target hardware. Introduce some stuttering, e.g. by running some benchmark program in the background or limiting CPU frequency. See if the issue impacts the gameplay. If it works, it works.