That is a false equivalence, a sword and a gun are two different tools for two different applications. They each have a use, they each have a virtue, there is some overlap as they are both weapons. I think of competition and self defense in a similar fashion. Both are combat, in both instances the goal is to win. The terrain and methods differ significantly. In self defense, there may be multiple opponents, weapons, water, glass, etc. Going to the ground may be better in one situation, but there are no guarantees of anything in the street. This is where I will make my argument that if competition style “fighting” is all you learned, you may not come out on top. That is metaphorically and maybe even literally speaking, bringing a sword to a gunfight.
Going to the ground is actually better in multiple situations. If you're a teacher having to deal with a crazed student, taking them to the ground and pinning them is a good way to diffuse the situation without hurting them. Same applies if you need to control a loved one.
If you're dealing with a better stand up grappler, being a superior ground grappler may give you a chance, since excellent stand up grapplers like wrestlers rarely learn submissions.
Dealing with someone throwing strikes, closing the distance getting into the clinch and taking them down can reduce your chance of severe injury.
If you're a woman in an inferior position and getting attacked or sexually assaulted, learning BJJ escapes, sweeps, and especially chokes from inferior positions can be critical to stopping an assault and maybe even saving your life.
If you get knocked to the ground and have to fight off your back without much chance of being able to fully stand, you better learn how to get them to the ground (which is possible if you know the sweeps from that position).
There's more obviously, but going to the ground has a myriad of benefits.
As for the sword vs the gun, the point is there isn't much point in learning how to use a sword. You're not going to be carrying a sword around all the time, if ever, and you really can't replace sword application with a broom stick or a baton. It seems rather silly to spend a great deal of time learning sword work for self defense if it's something you're never going to really use. Given America's lax gun laws (if you live in the US) you're better off buying a gun and going to the range for target practice.
BTW, I always find it amusing when the multiple attacker argument pops up, because that's a worst case scenario REGARDLESS of what martial arts system you take. It's not about going to the ground is a bad idea in a multiple attacker situation, it's about the fact that a multiple attacker situation is very bad period. The discussion should be avoiding getting attacked by multiple attackers in the first place, because even if you're mister "I'm staying on my feet no matter what", you're going to lose in a multiple attacker situation. The only art that has a high chance of success in a multiple attacker situation is Run Fu taught by Sifu Nike and Sensei Adidas.