Reliability isn't a big problem, its just essentially an entry cost for a simple weapon. The problem is everyone seems to think bullets chew through armor especially well or something. They have volume of fire, simplicity, and adequate damage.
Bows - Excellent rate of fire(that is, D&D rates of fire are about right), excellent penetration(they actually hit harder than a sword because all the impact force is concentrated into the point, and the bow being basically a spring, stores more energy in a single pull than a sword swing), great range(if you actually arch the arrow, you tend to get more distance out of a bow and bypass things like obstacles) and good accuracy. But a good bowman takes a lot of time to train, in technique and physique.
Crossbows - Terrible rate of fire(the D&D heavy crossbow reload has nothing on a real crossbow's crank and load time, you can't even pre-crank it because the crossbow would go slack after you do that too much), Excellent penetration(same reasons as the bow), fairly good range(can't arch a crossbow that well) and good accuracy. Simple to use is the key, you could round up a ton of peasants, teach them to point it in the right direction and fire it off. They would then spend forever cranking the thing, but well, theres more peasants where that came from, and crossbows are cheaper than good archers. They are more inaccurate than bows in use but thats mostly because crossbowmen tend to be less trained.
Guns
-Range: Bad rate of fire with the old muzzle loaded(but faster than a crossbow), but improves until you can get just below a bow's rate of fire(once flintlocks and cartridges are invented) and beyond(modern magazine loaded/automatics).
-Penetration: Terrible, the original ammo isn't even aerodynamic, so the bullet tended to tumble, the bullet itself is soft lead hitting hard steel, it splashes, until the armor piercing bullet is invented well beyond the medieval/renaissance age. What it has is volume of fire and...most of the troops on the field aren't heavily armored. A volley of musket fire would do the same thing to pikemen as a volley of arrows, and its cheaper. Against armored troops, bowmen would do better.
-Range: Terrible until rifling is invented. Thats fairly late on, as were aerodynamic bullets. And even modern bullets have problems with cover. Still again, volume of fire.
-Accuracy: See range. Between unreliable powders, irregular bullets that tumbled as they were fired and the lack of rifling, bullets tended to go every which way. And they tended to burst barrels every so often. Modern firearms got rid of the problem but machining would probably take a wizard or maybe Fine sized creatures with chisels.
-Simplicity: Can't be beat, only slightly more complex than a crossbow and that only for the older gun types, they were simple to use, had greater volume of fire(and thats what crossbows were used for anyway) and worked great on mook armies.