First time was with 40gr... next time with 38gr. These are NOT the same ammo. Bullet weights can have a big affect in outcomes, as can the load and QC of the ammo.
if 40gr worked, shoot more of that... but don't be shy to try other types of ammo cause you have no idea what is going to work.
Like every other rimfire, they can be picky and there is no one answer for them all. Currently, I am rocking aquila 38gr HP in bulk boxes from Can tire. This ammo shoots plenty good in this factory barreled 10/22 even at 100yds... tried 2 different lots so far with similar results.
By contrast, this 10/22 will happily miss a large target using Fed 38gr HP. I don't think I can even hit the dirt with the win bulk pack stuff.
Why do I have the Fed and Win bulk ammo? Cause these are what work best in my bolt rimfire... with the Win being the long distance option in this rifle.
Try a few types... you have no idea what will work until lead goes downrange. When you find something acceptable, buy as much of that lot as you can afford cause the next batch may not shoot like the last.
Good luck.
Jerry
PS if you shoot with others, split the cost of a selection of ammo types. That way everyone gets to send 10 to 20 for min investment. If the groups look bad from the start, move onto something else. I like to foul the bore with 10rds of any new type before shooting a couple of groups. Running a dry patch through before fouling shots can speed up the switchover as well. All I want at this point is a good vs bad answer. Then I will spend the time with the 'good' ones to focus on what is best for that rifle.