The main reason that archery lost out against guns was the amount of training required, a professional had to go out every day and shoot from being a child in order to build up the body strength and aim required.
This is a fairly common misconception. People did practice archery from a young age but more because it was a fun and entertaining thing to do that had practical value that was actively encouraged by the crown, this ensured that there was a large amount of skilled bowmen should the situation arise in the future.
You don't need to train all day every day from a child to pull a fairly heavy bow. Most modern target longbows are in the 35-40lb range, anyone of reasonable health should be able to pull them, and any healthy adult should be able to pick up a 60lb bow and draw and loose that with no worries as long as they have reasonable technique and have been practising on a lighter bow for a month or two. I've only just gotten back into archery (six months) and I'm already up to a 100lb warbow, and I've just placed a deposit on a 150lb self yew warbow that I'm fairly confident I'll be pulling in another six months time. This is a fairly good approximation of the estimated draw weight of the majority of medieval war bows. So from a cold start and practising twice a week for a couple of hours, and having the odd all-day session when the weather was good in just over a year I'll have gone from 35lbs to pulling 150lbs, and I'm in no way shape or form fit, healthy or in any kind of shape. And bear in mind your average medieval gent was far healthier and stronger than the vast majority of modern people because life simply demanded it.
I don't deny that it took training and practice to become skilled with the bow, much more than the often inferior firearms that initially replaced them, but it certainly wasn't required to start from being a child to build up strength.
There are a lot of urban legends about medieval archery (having to train all day every day to become strong enough, the obligatory "V" sign coming from archers having their fingers cut off if captured by the enemy, skeletons of bowmen being disturbingly deformed because they'd been pulling heavy draw weights all day every day, etc) and most of them are just that; legends.