Could a middle-classman eqivalent afford a whellock or later flintlock pistol? How realistic would it be to give them to regular bandits with an explanation that they've gotten them from soldiers' corpses?
Grades of Guns:
We are used to the idea today that guns should be clean, efficient, and highly functional weapons that work more-or-less like they are supposed to, fire multiple shots, and generally are pretty effective.
This has not always been the case.
History is littered with a lot of crappy weapons using questionable engineering and generally being pretty unreliable. All the pretty guns made by good companies and sold to rich folks are in museums and private collections. But a lot of guns were simple tools of hunting, and a person who needed to hunt could get a gun that might not be pretty, safe, or reliable, but that worked. Many pistols, for example, weren't much more than a metal tube of dubious quality filled with powder and a questionable trigger mechanism (the specifics depending on the period). In the 1800's, industrial manufacturing allowed some truly lousy weapons to be made in vast quantities and very cheaply. The introduction of the percussion cap allowed some REALLY terrible engineering to still be technically a functional gun.
A poor man might have a gun a hundred years out of date, but they could generally buy one, borrow one, inherit one, or steal one if it was needed. For a lot of history, the cheap model was a matchlock. These were poor guns for bandits. They had to be lit on fire to use (not conducive to quick reactions) and they smoked once lit (a tell-tale you had a ready gun). They were extremely challenging to use in the rain and under damp conditions.
Once a reliable and relatively simple flintlock design was perfected, the ordinary models weren't absurdly expensive. Guns were still quite valuable, however, naming them a prime thing for thieves to steal. So yes, bandits were much more likely to have flintlock guns than regular folks (and it is quite probable they would be stolen). A businessman in much of this period could buy a simple handgun. Matched sets were not uncommon, more because each was a single shot rather than because of dueling.
A wheellock was actually a quite sophisticated piece of engineering based or similar to designs by Leonard Da Vinci and later designs like the flintlock were a lot cheaper than the intricate mechanics of the wheellock. They required a lot of careful maintenance. A well maintained wheellock was probably a better gun than even a flintlock, since the sparks would be generated directly on the powder and would be resistant to rain. It's not a weapon for a commoner.
This gun was used by postal carriers, and would be the kind of relatively cheap weapon affordable to more normal folk.
This second gun was a weapon issued to French officers, and is likely similar to the kind of gun one might steal off of soldiers. Common riflemen were unlikely to own pistols, and soldiers were at many times among the lowest paid people in society. A stolen pistol would be an officer's weapon.
Wheellock pistols were the first readily useable concealable pistols, and they would be highly prized by highwaymen, but the maintenance and cost would make them tricky in this role. They were outlawed at times due to their usefulness in assassinations.
Smooth bore flintlocks are not terribly difficult for most blacksmiths to make. Forge welded barrels, usually a screw in breech plug. For the lock mechanism a simply V shaped spring. The spring steel might be one of the more difficult materials to make.
The best barrels should be drilled using long drill bits. For rifled barrels more work is needed to do the rifling.
There is a lot of filing work. It is time consuming which is why early firearms were expensive.
The industrial revolution with machining tools drill presses, lathes, milling machines and shapers greatly reduce the cost of making weapons. This is one of the factors responsible for an increase in the number of firearms. They went from handcrafted master pieces taking weeks of labor to mass produced item that could be completed in a few hours.