I have seen a few cases of it in particular.
The problem with such cases is they are not reported as a guy using self defense getting railroaded, but rather it is a story that someone was attacked with a knife or a mutual combatant used a knife.
Only in the details long after it is news does it come to resemble self-defense.
There is a lot of discretion in how a particular incident is reported, and how the results are viewed.
This is at multiple levels.
Police and detectives are more inclined to give more benefit of the doubt to a self defense shooter (absent other facts that bias them against the shooter) acting in a way they can relate to (and they all carry guns) and write a less biased report in general than a stabber all things equal. They will arrest both typically, but the report can shape perspective in court later.
Users of a blade tend to be viewed more as aggressors or mutual combatants, unless special circumstances show otherwise (like a home invaded, during robbery of business etc.)
Most self defense scenarios are less than perfectly clear to outsiders that were not present, with conflicting stories, and in such situations a bias can seriously hamper the legal outcome.
Jurors, especially those with limited or no experience with violence can understand pulling a trigger or pressing a button out of fear to stop a threat, but are far less able to relate to savagely cutting or stabbing someone in the ways necessary to stop them while grappling.
Shooting till the threat is stopped is much more easily done, while stabbing or cutting until the threat is stopped can result in what seems like a very excessive number of stabs in a courtroom.
Your average person on a jury familiar only with perceptions such as those promoted in movies thinks someone is instantly incapacitated from a stab or shot, or keels over.
With a gun a few more shots gives a rapid in the moment perception, but even though deep stabs or slashes can be just as rapid, the perception is that they are slow and it would take a long time to accumulate a high stab count. This increases the perception that what may have been enough to stop the threat in reality was excessive force.
Several shots is far more likely to seem reasonable than a dozen stab wounds.
In fact with 2-3 deep stabs a second possible, a couple dozen stab wounds while wrestling before they cease being a threat is quite possible. You know how many that sounds like when the prosecutor counts them off one at a time with a pause between each?
Someone can also fire a shot or two and stop, when at range, and assess before continuing if necessary while retaining control in many circumstances. But while in a struggle and using a bladed weapon that pause could easily mean losing the upper hand, being overpowered, being disarmed, seriously injured, or killed.
With a gun you step back and retain the advantage and control, and can then fire more if they continue the assault. With a knife you step back and the attacker regains a much more neutral position if they choose to continue the assault.
So you are at a decided disadvantage after the fact when your actions are being scrutinized as well, or at a disadvantage if in the second go they manage to inflict serious or lethal damage to you after you had previously had the advantage but stopped.
Search for cases where someone is said to have defended themselves with a knife. That is rarely the way the story is told to the public, even if that is what happened. While you will find endless such stories of self defense with a firearm. But you can be sure it is not because of a lack of people utilizing knives as self defense tools. Rather it stems from a very different perception of the users of such tools and how people relate.
The exact same situation where you use a gun in self defense in public and are treated initially as a victim or at least neutrally will often have you seen as the aggressor, mutual combatant, or user of excessive force with a knife.
You will also see a disparity of force defended often if a gun is used against a bigger stronger violent attacker, or against more than one. How often do you hear of a disparity of force if someone pulls a knife on someone unarmed?
You typically don't, the knife puller becomes the bad guy. Instead you would hear about multiple stabbing "victims".
Another part of the equation is perception to witnesses. The user of a knife is actively engaged in moving and attacking, even in defense. You can't wait for an attacker to impale themselves on the knife to stop an attack.
There is multiple slashing and holding techniques, but almost all techniques require actively going for targets on the other's body.
While the user of a gun in self defense is typically not advancing, and is often standing still or retreating or back peddling or hiding behind cover. The bullets close the gap and go for the targets. These movements seem less aggressive after the fact. While the active attack of the knife user gives more of a perception of pursuing the conflict.
The user of a gun can also appear more calm, collected, and responsible during and after self defense. While the knife "attacker" defending themselves is engaged in aggressive high intensity movements that will leave them looking both more violent in the moment, and leave them more exhausted and strained and less composed after wards.
As a result the gun user can be easier to relate to as the good guy, methodically doing everything right. While the knife user looks more violent and savage and random.
The same perception extends even further if the incident is recorded.
Now imagine on top of all that the prosecutor putting in the Cold Steel demonstration video to show the weapon you used...the "weapon" you went out of your way to acquire.
For some reason you get brownie points in society for being disarmed and randomly acquiring an available weapon in a life or death situation. But if you carry one around or brought one, you are seen as someone looking for a problem.
Guns though escape some of this. Even a soccer mom or house wife on the jury can often understand wanting to have a gun in case one of the bigger stronger men in the world poses a threat, and this is increased as concealed handgun permits become more mainstream.
But they certainly won't relate to using a blade to savagely take them down, getting covered in blood, and using various hands on techniques to accomplish it. They just can't relate, and that means you are far more likely to go to prison for it.