I know in aircraft & racing car they can not use a bolt that has threads in contact with the mating pieces. I don't now the actual tolerance on this. Anyway they use bolts that are sized to specific lengths. They are available commercial market. I think they are called AN bolts but it's been a while since I needed any.
I used to get them at Pegasus racing.
http://www.pegasusautoracing.com/
Of course you can make them on your lathe and harden them, I don't think airgun is that fuzzy about hardness. On the other hand do you want bolt to wear or the barrel latch? might want to use soft bolt, much cheaper to replace.
Art