Ok. So firearms don't work in D&D because we can't accurately portray them like we see in the movies??!
First, movies aren't very accurate. Second, D&D is even less accurate than movies. Third, its a GAME. Games are usually designed to be balanced, challenging, and/or fun. There is no point insisting that rules for firearms needs to be realistic and accurate in a game where sword damage, armor class, and hit points are abstract numbers that don't add up to simulation.
But it is a game, so anything is possible. You want firearms for 5e? I'm sure it can be done, if it hasn't already. Lets try a more positive approach. Here's one idea based on some of the current discussions:
Firearms
Proficiency: Just like martial weapons and tools, characters must have proficiency in Firearms to use their proficiency bonus. In a typical D&D setting where firearms are not common, this option may not be available for any class. Instead, it may be gained by acqquiring a specific background, or as a feat. Other settings or campaigns where firarms are more common may make this more accessible by including it with certain classes or more backgrounds.
Damage: Guns are the great equalizers. Make it as potent or better than the best weapons in the game. I suggest 2d4, 2d6, 2d8 and 2d10 for various types and sizes. No ability modifiers unless as a special feature or option, like a feat. The more powerful ones will also have other drawbacks to keep things balanced, such as slow reloading, limited ammo, rarity and cost, and unrelaibility.
Dangerous: Guns have a higher probability for a critical hit because it can penetrate most armors better than any normal weapon. But attack bonuses undermines the value of armor (and other defenses), while higher crit bonuses will inflate the already inflated damage dice. A better solution could be more "old school" with a higher crit range. (i.e. score a critical hit on an attack roll of 15-20, for example). Auto hit, but only double damage if roll equals or exceeds target AC.
Unprdictable: Balancing all this out is the misfire or jam potential. Mirror the high crit with a equal high fumble (i.e. firearm suffer a malfunction on an attack roll of 1-5). The weapon becomes useless for the rest of the encounter unless the character can fix it with an appropriate check(s), usually takes at least one full round.
You can go hogwild with variations and options at this point, but something like this seems workable. It is balanced with controlled accessibility and tempered by risk/reward potential. And it should wok within the design constraints without upsetting balance.