What if you had a scoped rifle with both a short barrel and a long barrel, and both barrels gave you the exact same velocity with a well stabilized projectile. On an airgun, would the shorter barrel tend to be more accurate or the longer one, and why?
-----You can ignore this long winded stuff below unless you are bored -------or might want to be bored------------
My experience with regular firearms has been that shorter barrels that still work well with the chosen chambering, quite often produce better accuracy than they gave when they were longer. I have no idea if that often applies to airgun barrels or not as I have only shortened one 22 cal airgun barrel, but my guess is, to some extent it does. The one I shortened shot better than it did at full length.
But you usually give up velocity in both, some more than others, though not much with some chamberings. Longer barrels with smaller boiler rooms in powder burners can actually reduce velocity and decrease accuracy. If you are using iron sights and the front sight was at the very end of the barrel each time with the rear sight in the same position as it was shortened, I could see a longer barrel in a firearm or an airgun, that didn't shoot as well as it might if shorter, perform better with the iron sights because of the longer sight radius.
I had an OK shooting .223 Rem heavy barrel Savage with a a good crown on it at 24 inches long. Just for fun after reading the much retold story about the 21 3/4" barrel length thing in the Houston Warehouse, I decided to cut mine to that exact length. I literally chopped it with a hacksaw to just over 21 3/4" then flat filed the crown by hand until it was pretty dang clean, deburred the muzzle to crown corner with a brass lap and fired some groups. It went from around 1 MOA to sub 1/4 MOA with Sierra Match Kings. A fluke? Maybe. Houston Warehouse Magic? That is what I am sticking with.
It would be fairly difficult to start with a 16" barrel then add an inch until you hit 36" and see if accuracy got better with length, but I have seen longer barrels improve when shortened, many times, yet not once when they were lengthened!