There are a couple of ways to go with this relative to actual history and the simplified nature of combat in DnD.
Historically muskets, arquebus and pistols were much worse that their crossbow and longbow equivalents up to the invention of rifles and automatic weapons when used by a trained person. They had horrible accuracy (as shown by the formations in battle at the time where you would line up 30m distant from the enemy and slug away for hours only killing/wounding a couple hundred men on both sides) and their penetration power was unable to beat properly made plate armour, which is why in the "musketeer" times many soldiers still wore breastplates and metal helmets. Even in Napoleonic times heavy cavalry still wore metal helmets and breastplates to turn aside critical blows and musket shots to their body (and Napoleonic soldiers often had rifles for greater accuracy).
Longbows had a greater accuracy at further distances, much greater penetrating power, and most significantly a much much higher rate of fire. Some historians believe the until the invention of the machine-gun the longbow was the most deadly long range weapon in existence. But because of the training requirements to be an effective longbowman (hours of practice every week, strength to pull a 100lb test bow, etc...) firearms were just more efficient. You could equip a huge army of nobodies with no training with firearms and in a few short months have an effective army. It was the point and click version of the longbow. It didn't matter that they were not as effective killing wise when you could have 7 times as many of them at the same cost.
Also firearms made massive amounts of noise, smoke and flame. Their effect in battlefield moral cannot be understated. Its effectiveness as a shock weapon was extremely good, far greater than its ability to actually kill people.
The reason heavy armour went away was just as much a matter of cost, improved manoeuvrability, field repair as it was that firearms got better. Mostly cost though really when you get down to it.
The reason we have a hard time excepting this is we have a decidedly modern take on firearms, where their accuracy is high, and often their penetration power is high. There is a reason kevlar can stop a pistol shot. Because normal 9mm pistol have big slow bullets. Muskets and pistols from early firearms times have big slow bullets. Plate armour and other armours can stop them.
If you look at the abstract that is DnD and apply the primitive firearms to it the rules from the DMG are fairly good IMHO. HP represent an abstract concept in characters at high level. Its not that the character is necessarily tougher its that they know how to turn a deadly blow into a scratch by angling themselves a certain way or partially parrying the attack with their shield. This can happen with bullets as well, as the character moves at the last minute spoiling the aim and is only winged by a shot etc.... its no different than a hail of arrows, sling stones or quarrels. In Sharpe, Hornblower etc... they are always getting shot, winged, cut, beat up and come back for more. In real life Blackbeard the pirate (Edward Teach) was shot 5 times, cut over 20 and finally died to a pike wound in his last battle. If that isn't real life DnD I don't know what is!
Also as the races of the world must create armour to deal with magical attack then it makes sense that these same techniques are effective against firearms attack. What's the difference really when you get down to it between an Eldritch Blast and a pistol shot... same damage, same attack roll. Ones magical and the other is technological, but they both do exactly the same thing. To a person from medieval times a pistol would look like magic!
It really just comes down to how deadly do you want firearms to be? I actually think the ones in the DMG are a bit powerful given longbows are 1d8 dmg (should prob be 1d10 but that's a fantasy gameism). Their ranges are ok given the ranges of thrown weapons and handxbows. You could actually make them simple weapons as well, leading to more widespread usage in the game world and explaining why they are replacing heavyxbows and longbows in the hands of the people and soldiers.
As a final point I LOVE what you are trying to do here. Its exceptionally cool and I hope that it works out for you.