From what I understand boys were accurate at a longer range than muskets were, how then did muskets overtake bows as the primary weapon of war if they were less effective?
If range is your only qualifier then yes I suppose that guns had no reason to overtake them. However we can't look at this as a video game with stats, thats not how real life works, we need a whole picture. It goes as follows:
Guns did not suffer from this issue. Guns had muzzle velocities several times faster than an arrows or crossbows peak speed. This allowed greater kinetic impact force. Further unlike a bolt or arrow a bullet does not require to hit at a specific direction lest it deflect harmlessly.
In comparison a musketeer takes maybe 2 weeks to become good enough. Further it requires significantly less physical strain. This is a massive freaking point, don't just overlook this: Being able to train thousands of men manners of weeks rather than years can not be overstated. Especially when we're talking about very marginal differences in range as you propose.
Guns do not suffer from this. You choose a gun design, make a cast, and bam. You pour into the cast and you got a gun in a few days max. Bullets are also casted and made en masse. It is much easier to supply an army with them. Further if one breaks you can just get a replacement part since every gun is the same. A bow breaks and it's broken.
The ultimate point however is that guns did not just instantly take over. They were implemented in the late 1400s and it took until about 1700 for them to "win out" as the primary weapon of war. It was a gradual shift and at first they were ancillary tools used to make huge booms and scare the piss out of people. Crossbows and bows being mixed with guns in the early 1500s was not unheard of. However at the end of the day when gun armies faced up against non gun armies during this transition period, such as at Pavia, it was a one sided roll over nearly every single time. That is not a coincidence.
Western Warfare in the Age of the Crusades, 1000–1300, John France
The Rise of Modern Warfare: 1618-1815, H.W. Koch
hi! FYI, you'll find more on this topic in the FAQ