A lot of uneducated nonsense here.
Can bladed weapons be a real threat to a person armed with a firearm? Yes. Police procedure dictates that the minimum safe distance for optimal safety against a potential attacker armed with a blade is +4 meters.
This is especially the case with blades like knives that are concealed.
The reason this is the case, is because an attacker that preempts and runs at you with a blade, is very likely to reach you and cut you before you get to draw your weapon, much less discharge it, due to what is called the "reactional gap".
Unless you hit a viral organ like the brain or the heart, an attacker might very well keep on coming even when hit several times by an ordinary firearm, like a 9mm handgun, or submachinegun, depending of course on size, level of aggression, and drug or alcohol influence.
Of course, if a person is standing at a ready, with weapon drawn at +6 meters, it is very unlikely that a blade wielding attacker will be able to reach attack distance before being shot down, which is why modern armies and law enforcement use guns, not blades.
Hand to hand combat and knife combat only makes up a tiny fraction of modern combative training, and any professional career "warrior" would consider it a severe breach of protocol to get into close-quarter combat, as it would mean that they've neglected not only their primary weapon, but also their side-arms and are presumably working without backup from partner or squad.
As for guns versus swords in a game setting :
It's not really a very relevant discussion. Most RPG combat is symbolic - an abstraction that uses numbers and statistics to make action sequences doable in a game context. They aren't relevant in terms of the narrative.
For example in FF7 -
Cloud isn't really getting hit by tons of machinegun bullets. Cloud is a ridiculously strong and fast, genetically altered person. Presumably, he's dodging the gunshots and using his super strength and materias to best armed opponents. However, due to hardware constraints and the traditions of the genre, we're left to imagine this, as the battlesystem uses a numerical system to make the battle sequences feasible from a gameplay perspective.
How else would you demonstrate Cloud's strength in gameplay while heeding narrative realism by making him weak to bullets?
The same is true for pretty much all games.
I would imagine that in pretty much any universe where guns and swords co-exist, we're supposed to accept that on the same premises like light-sabers in star-wars, namely that certain people are just so kick-ass that they can make it work.
In real life though? No. Unless you're going to jump people when they're not prepared, within a 4 meter radius, you're never going to be better off with a blade than with a firearm.