I am not an expert, but I have studied a bit about this issue.
Barrel length is not very directly related to accuracy. Barrel stiffness is closely related to accuracy, and shorter barrels are actually stiffer.
Barrel length gets you velocity, and velocity can contribute to accuracy at longer ranges. But longer barrels gain the most velocity with rifle rounds that have high pressures and large case capacities. Think of 6.5 Creedmore as a round that wants a longer barrel.
Most testing I have seen shows that .22 LR rounds reach maximum velocity at around a 16" barrel. This is especially true with rounds known for accuracy. Ultra-high velocity rounds might increase velocity with longer barrels, but most of those rounds are not known for accuracy anyway.
So my thoughts would be to choose a fairly short barrel so that the rifle will balance nicely even with a pretty fat bull barrel. The real key issue for accuracy will be barrel quality and manufacturer, not length.
Now if you want to start down another rabbit hole, you can research about chambers. There are different tolerances and shapes for .22 chambers, and these do matter for extreme accuracy. As the chambers get tighter, there are compromises of slight increases in accuracy versus a rifle that is picky about ammo or slightly less reliable.
But overall, choose a premium quality barrel that is built for accuracy, and has some type of match-ish chamber, and it will shoot very well. It should out-shoot you for quite a while, and that will be enough to have plenty of fun with a first build.