Perhaps it would help if we would elaborate a little for you on the history of muskets…
As mentioned, muskets of the period were inaccurate and slow loading. Why? Well, they were inaccurate mostly because they were smoothbore (as opposed to rifled) and the balls they fired were not perfectly round. Bullets would tumble erratically in the air and would therefore randomly deflect. Rifling would later fix much of this problem and would extend the effective range of musketry from 100 yards to 400 yards or more. And of course most of us probably realize the difference between loading a musket with powder and shot and loading a gun with modern cartridges.
We also must take into account the method with which the gun is fired, commonly referred to as the “lock” (presumably so-called due to the similarity to locks of the period). The earliest handheld guns (roughly 1300’s) were nothing more than miniature cannons held in a gloved hand or on a pole. From multiple craftmen came refinements in the design, and the matchlock evolved sometime during the 1400’s. It used a burning wick to light the powder in a flashpan, which in turn lit the powder in the breech, firing the gun. There was some delay between pulling the trigger and firing, which led to further inaccuracy.
If my chronology is correct, this is the type of gun the musketeers would be carrying. It is technically possible that they could have had wheellocks, which were intricate and expensive, but those definitely were not standard army issue. The wheellock had a winding-watch type mechanism to strike a spark against an iron pyrite wheel, IIRC. The flintlock (which made matchlocks obsolete) did not make an appearance until the 1700’s, percussion caps were invented somewhere around 1830.
My history here is a little weak, but the Army tactics of the day were basically “shot and pike”. In other words, you marched toward the enemy formations in ranks and unleashed a single shot volley of musket fire, then closed the distance and stabbed each other with long spears (aka pikes). Elite, trained troops would use swords instead of spears. Eventually the bayonet would make the gun and pike the same weapon.
(This is all from memory, so don’t quote me.)
The other logical reason you’d use a sword? Stealth. If you can only fire your gun once, and it attracts everybody’s attention, it’s probably not a good idea. Stabbing a guy in the back doesn’t make nearly as much noise.
What, you think all these guys were chivalrous?