S&W Chad and H Richard pretty well covered the bases, but I'm both going to add a bit more and talk about why it may or may not be what's happening here.
Waaaaayyy too many shooters think more magnification will increase resolution and precision. That's just not the case.
As noted above exit pupil matters as any light outside your pupil is wasted, but worse an exit pupil smaller than your pupil means the fovea of your retina is not fully illuminated or utilized. The effect is a lot like using an electronic zoom on a camera, where a much smaller portion of the chip is used to create the "zoomed" image, but the result is a grainier and darker image.
As noted above with the 36x target scope example, the image quality is poor and, to the extent it works, it works because the target is high contrast.
The current fad driven crop of long range shooters also over magnify thinking it will produce better resolution and let them see the target better, but it doesn't. It might work on steel plates with high contrast against the background in good light, but it won't work with low contrast targets, or in low light.
A lead splashed plate against a dappled tree line and in shadow can be very difficult to see at high magnification. However it will jump right out at you at maybe half that maximum magnification.
There are two things that produce higher resolution - larger objective lens diameter and higher objective lens quality. The cost of larger objectives of the same quality level rises exponentially with diameter, and the cost of more quality also increases exponentially. So a 56mm scope will cost a lot more than a 40mm scope, and if that 56mm lens is also very high quality the price will start with a 3 or a 4 and have a comma in it.
Even then, while the larger lens increases the magnification that can be supported with an adequate exit pupil there are still finite limits. On a heavy overcast day or near dawn or dusk, where your pupil might be 4mm, a 56 mm objective will have a 4mm exit pupil at just 14x. On a partly sunny day with a 2.5mm pupil, a 2.5mm exit pupil occurs at 22x. With a 50 mm objective those magnifications drop to 12.5x and 20x. With a 40 mm objective it drops to 10x and 16x.
I much prefer a razor sharp image to more magnification, and I shoot 1000 plus yards with a 4-14x56 scope. The highest magnification long range scope I have is a 5-25x50 and I almost never use it at more than 18x, and then only on bright sunny days.
——-
That's all good to understand but it's not as relevant with a 3-9x40 scope.
In a 3-9x40 scope the exit pupil will be an 4.4mm ample even at 9x, and work for all but the lowest light conditions.
That said, in the VX Freedom series lens quality is ok, but not stellar so you *might* find the image is better at lower magnification.
Or not, as there are two other things that come into play.
1) at higher magnifications the depth of field becomes shorter, so the range of distances at which objects are from the scope and will still be in sharp focus is much smaller.
That is most evident at short ranges like 25 yards, when the scope is really designed for 50 yards to infinity. I suspect that is 99% of your problem with the fuzzy images at 9x and 25 yards. You will get a longer depth of field at 6x and an even larger depth of field at 3x. That will give you a much sharper focus at close ranges with lower magnification.
Try focusing at something just 10 yards away. 3x will look a lot sharper than 6x, and 9x will look positively horrible.
For that reason higher end rimfire scopes will come with a parallax and focus adjustment to enable the shooter to use maximum magnification at short distances and still get optimum performance.
Many companies use the term "rimfire" to denote just a shorter fixed parallax adjustment of 50-60 yards rather than the 100-150 common on fixed parallax center fire scopes. "Rimfire Target" usually refers to a rimfire scope with a parallax and focus adjustment down to 10 yards or so.
2) parallax error is much more pronounced at higher magnifications. 9x is about the upper limit before an adjustable objective or other parallax adjustment is necessary, which is why you see a lot of 3-9 variables with no parallax adjustment but almost no scopes with a max above 9x that do not have a parallax adjustment.
While focusing on a target at 25 yards at 9x move your eye around being the ocular lens without moving the rifle. You'll see the cross hairs move across the target. That's parallax error. As you can see consistent eye placement behind the scope becomes absolutely vital to accuracy. That's where all the hullabaloo about a good cheek weld comes from.
Now move the magnification down to 3x. Note how much farther you *can* move your eye and still see the full field of view. That's showing you the different the larger exit pupil makes in terms of allowing a more liberal eye placement. But also notice how much farther you *have* to move your eye to get the same shift of the cross hairs on the target compared to 9x. That shows how much less parallax error you get for a given amount of variation in eye placement at lower magnification. Cheek weld still matters but it matters a lot less at low magnification.
——
Great accuracy is possible at just 1x provided the sights and targets allow precise alignment. That's the basis behind front and rear aperture sights.
The front aperture is selected or adjusted to allow just a thin ring of light around the bullseye, and you stop thinning it at the point that ring starts to get dim. That more or less lets the ring of light "pop" a bit when the aperture is perfectly aligned with the light ring is perfectly symmetrical around the bullseye.
The rear aperture is reduced until the image starts to dim and then is backed up a notch until full brightness is restored. This gives maximum resolution with maximum depth of field and minimum area for the eye to center itself in.
How larger that setting is will depend on how much light is available, with more light allowing a smaller aperture. The same is true for the front sight aperture.
The Mark 1 Mod 0 human eyeball can detect differences as small as .005" under ideal light and contrast conditions and that's what aperture sights and black on buff or black on white targets are designed to create.
The only thing that a scope does better is allow you to see small and or low contrast targets at long distances.
Hope that helps…