Guns versus Dwarfs

I noticed, that R14 Gun has exactly the same value for Dwarf like R14 Crossbow, even if Dwarf has more Weapon Skill with guns than crossbows. Technically R14 gun should be better and much recommended by weapon skill profits.

Maybe something is wrong is with formula?

We do factor in all weapon skill racials and stats.

My guess is that you are looking at the ranked list for a character who is already at the hit cap – in that case, the gun is no better than the crossbow. If you were to e.g. lock in the gun, it would probably swap out an item with some hit to accommodate. If you were to then look at the ranked list again, the crossbow would likely score lower.