The Dune answer is meh. The only real justification is a very specific set of circumstances.
1. Body Armor is sufficiently advanced that explosives and fire-arms are not very effective against it. I'm not just talking "Its meh" I'm talking "You'd be better off hitting people with pool noodles if they're wearing this shit"
2. The material for making body-armor breaking weapons is so expensive that its only practical to construct melee weapons with it.
Warhammer 40,000 is a good example of this, as bolters are only moderately effective against Power Armor, lasguns less so, and Power Weapons are expensive and hard to construct, and are with few exceptions the only effective things against Power Armor.
However since those other exceptions include tank rounds and explosives, it still doesn't make much sense.
But thats the basic ideas of how you'd create a semi-realistic setting in which melee weapons were superior and common in a post-gun setting.>>29551980
Here at least one of two situations needs to be true. One is the above, but "Fists" are the powerful material. This would include something like nanobots or Ki making it so, but that begs the question of why not just use Ki on your weapons a la Trunks?
The second possibility is that the characters are so powerful the only thing strong enough to damage people is themselves. You'll see this in comics where weapons are so fragile they just shatter, and the only effective way of taking out a villain of sufficient strength is through grappling them.
Superman killed Zod by breaking his neck, because throwing Zod at damn near anything except Superman flesh was not going to work.