Switching is an exploit whereby the player shoots a gun or swings a sword until the penultimate attack of the string, and then switches off to another weapon to continue attacking. While commonly used with guns to skip the reload animation (hence, switch shooting) it works with swords as well, bypassing the invisible cooldown between sword attack strings as well as skipping laggy finisher attacks.
I do not think that weapon switching is itself a problem. Rather, switching belies the real problem: finishing attack strings sucks! For guns this is the most obvious, because your knight is forced to stop attacking and slow down for the reload animation. The Gunner Update attempted to fix this by making reloads safer or faster, and as this did not actually address why nobody liked reloading it did nothing to actually solve the problem.
For swords, your mileage may vary, but generally the final hit of a sword string does a bit more damage and knockback, but is slower meaning that it holds your knight in place for longer and prevents you from attacking for longer. Shield-cancelling the final swing removes the commitment problem but still forces downtime unless you switch weapons. While the intended value of many of these finisher swings is clearly their flinching property, rewarding knights to play risky and interrupt enemies just before they can attack, enemy scaling from party size can cause enemies to gain enough health that the flinch no longer works, making the finisher actually detrimental.
Starting with swords, the solution is pretty simple: just make finishers worthwhile. DO NOT make them safer. Sword finishers carry a perfectly reasonable amount of risk already, especially since shield cancelling and weapon switching already exist. Instead, they should have a reward proportionate to the risk they carry, and should have consistent performance in large parties. While swords have meatier damage values on their finisher swings, they usually are not large enough to make them worthwhile: finishers should be pretty reliably safe on hit (since they still leave you vulnerable to any other monsters in the room) and hit hard enough to be more damage than continously mashing out the first attack of the string. Some swords also have trouble with connecting at all because the previous attacks knock enemies just a bit too far away (an issue outside the scope of this post). Removing the cooldown between attack strings might also significantly improve the feel but could have a butterfly effect that leads to Cutters becoming depressed and developing a Dark Matter addiction.
Guns are a bit more difficult because, as they are, they perform a series of identical attacks and then a reload animation with no benefit. I see three main approaches to this problem. The first is to make continuous fire ramp up in strength somehow, even something as little as making the final shot before reloading more powerful or have a special effect: this makes reloading an exchange for the strong attack and works similarly to sword finishers. The second is to make reloading some kind of attack or confer some kind of benefit: this essentially turns reloading itself into a kind of finisher attack. The third is to make handguns track their remaining ammo and slowly regenerate it over time: reloading then becomes a choice to commit to the animation to keep attacking sooner or swap off and wait for the ammo to regenerate. The point of all three of these ideas is to turn reloading into a choice, like sword finishers: commit for power or switch for safety? Some of the Gunner Update changes that made reloading safer could probably be (partially) reverted as well, both to make choosing to reloading impactful and so that Antigua's quick and safe reload is a benefit instead of an afterthought.
Switching itself is harmless and will naturally disappear if using weapons in the intended way is more desirable, but I think should still remain in some sense because quickly switching to a different weapon when I don't want to commit to something dangerous is pretty nice. Changes targeted at punishing switching will almost certainly harm legitimate players as well as displease people who are used to switching. As an aside, due to an oversight, having two identical weapons makes switching ineffective, and this should probably also be addressed.
tl;dr people switch because completing attack strings is frequently high-risk-low-reward. Make completing sword combos and reloading guns consistently worthwhile (if done correctly) and switching will pretty naturally disappear.
(Edit: I don't know why I was waffling on finishers needing more damage. The fact that they underperform is the entire point.)
I've always really hated that the "meta" way to play the game is to do an incredibly repetitive sequence of just "attack just below the max combo length -> shield cancel -> switch weapon and back -> repeat". It feels incredibly awful to do and I can literally feel my hands cramping as it goes. Weapon switching on its own is a cool tech but the fact that just doing it constantly is so much better than using it sparingly makes me sad. I'd much prefer some kind of solution that allows the tech to still exist but stay a tool rather than my primary method of fighting. This seems like a good starting point.