I’ve long noticed my shooting tends to vary from just ok to wonderful depending upon the range I am using. I had thought it might be unfamiliarity or nerves or who knows what causing the larger groupings on certain ranges, but it turns out to be something much simpler than that, light. If you cannot see the sights, you really cannot aim with precision. I was on a range and it was dimly lit and I shot poorly. Soon after I was outside on a bright day and shot very well. The next time I went to the range I asked if they could increase the light in my lane and I shot very well again. That was the aha moment when it struck me the dimmer the light the wider my group and basically it was because it was more difficult to see the front sight.
I have always had extremely bad floaters (essentially trash in the eye which is not expelled via the canals of Schlemm) and any white background appears to have moving lint and blurry areas. Couple low light with a generally whitish background target which is illuminated and it only aggravates the issue. I’m always on target, but the lower the light the larger my group. So if you are not shooting as well as you think you should it might be a light issue. I know for me, the more light I have, the better my groups.
Note: I have a pistol with night sights, I’ll have to try that on a dimly lit range and determine the results.