I remember there being a discussion on this when I joined the board (centuries ago). These were points I can remember because I thought arrows had an advantage over early muskets.
-Crossbows are heavy.
-Bolts affected very heavily by wind. Bullets are too but not as much.
-Less stopping power than a musket. Bolts do not have the penetration power of bullets, can be blocked with shields, armour etc.
-Old muskets did more damage when they hit, seriously it's a lead ball fired at high speeds, wrecks face. While bolts are deadly, a musket bullets could take a limb if they hit the right spot and WAY harder to remove than a bolt.
-Crossbows cannot generally be used in the rain.
-Crossbows have a shorter range.
-Crossbows were actually quite difficult to maintain to an early musket, a crossbow was a lot of moving parts and if they fucked up they were harder to un-jam or fix.
-Crossbows are not as accurate as early muskets, as hard as that is to believe. Bolts and arrows fly in a parabolic arc, muskets fly at a flat trajectory and air easier to aim as a result.
-In terms of training Crossbows were easier than bows and muskets were (apparently) even simpler again. Remember its not only teaching someone how to fire and reload, but also maintain and repair.
-Muskets made for somewhat effective melee weapons and could fix bayonets, crossbows by comparison are cumbersome.
-Muskets allow you to carry more munitions.
-Finally, muskets are loud and scary. Can't see the bullets, suddenly you're dead.
-When it comes down to it, a mass fire of muskets bullets is FAR more devastating than a mass fire of cross-bow bolts and both were deployed in kind.
With these disadvantages in mind, crossbows are probably not going to remain a primary weapon for an army that wants to win. However, they could possible still see deployment in specialist situations. They are still used by special forces quite prominently as they are useful for deploying things like zip-lines but I'm not an expert in this field. That being said any ideas how these disadvantages could be minimized?