Sorry, I didn’t want to be specific because I tried to keep it short and to the point. However, I can think of a lot of reasons why guns might fall out of favor. Mostly, it’d come as armor. Kevlar is fantastic against bullets, but has a weakness stabbing. Just take that to 11. Another might be like Dune, a sort of energy shield that stops high velocity impacts, but doesn’t stop low velocity. Anyways, I’m mostly curious what could be modern sword technology, (nano-tech and cryoforge, apparently).
With the caveat that it’s been a few years since I read Dune, a few things stand out: I wouldn’t call the year 10,000 the near future. Dune is, very much, a post apocalyptic setting; humanity is in the process of recovering from domination by autonomous AIs. I’m not sure if this was a jab at Asimov, but, regardless.
And, personal shields are very rare, very expensive, and extremely fragile pieces of equipment. House Atredies is able to afford a few of them. This is one of the most powerful members of the LANSRAD, and an incredibly wealthy family.
So, it shouldn’t come as much of a surprise that the combat we see might not be completely representative of warfare in the setting. That said, when actual battles occur, the great houses and the Sardukar have no qualms in breaking out lasguns.
The personal shields can’t handle fire from lasguns, so ranged weapons remain preferable on the whole, and really only work against sword strikes. Hence the whole, “a slow blade penetrates,” because a normal blade strike will reflect off. I can’t remember if the shields could survive normal firearms in the setting, but they certainly didn’t change the nature of war in Dune.
The blade fighting in the novels is, almost exclusively, the purview of dueling, and while houses have “swordmasters”, the actual weapon of choice is long knives.
I will say; Warhammer 40k, Dune, and Star Wars all make for fairly reasonable uses of melee weapons in a sci fi context. Lightsabers have ways to stay effective against ranged foes (so long as they’re backed up with superpowers), 40k is loaded to the gills with things that won’t die from sustained bolter fire and ludicrously lethal melee weapons, finally; Dune has a fairly rich dueling tradition. But, I wouldn’t hold any of those up as justifications for a near future setting.
On the subject of Kevlar, it’s actually been improving at a fairly steady pace. Used to be, 9mm rounds posed a serious threat to someone, and now we’ve gotten to the point where a vest can take an intermediate rifle round at medium range.
The problem with Kevlar is one of the basic constants of the universe, entropy. While a modern Kevlar vest will stop a 5.56mm rifle round, at 50m, when you start getting closer, or taking more fire, the vest will fail.
I’ll add a primer on modern body armor, because this one can get a bit complicated, though fair warning, I’ll probably do that after I’ve done most of my firearms primers. If you want to do some research now, I’d recommend looking into Kevlar, and ceramic inserts. Also if you start feeling too cocky about body armor, look up the history of the 10mm handgun round, and steel core ammunition. If you want a setting where you can use a sword in a gunfight and live, I’d suggest Warhammer 40k. It’s comically over the top, but there’s some coherent world building, and it does present you with the kinds of things you’d need to be dealing with to see swords really return to the battlefield.