Self-defense and no-knock raids

The no-knock raid is probably the most reckless, dangerous, police tactic in use today.  Barreling through a door in the middle of the night to catch someone supposedly before they flush their drugs down the toilet is a recipe for a dead body or two.  And death is very probable for both the unwitting inhabitants of the raided house as well as the cops participating in the dangerously stupid scheme.  When someone breaks into your home, it’s natural to want to unload your shotgun on them, especially if you have a family.  If the cops don’t announce themselves, how are you supposed to know otherwise?  Several instances of a cop being shot to death by a homeowner who thought it was a criminal home invasion (well, these no-knock raids are criminal) have resulted in the homeowner being charged with murder, and the prosecutors bizarrely seeking the death penalty.  Some relevant stories here, here, and here.  The details are important, but questions of wisdom over the use of the no-knock, 3am raid should be front and center.  First, what should cops expect a sane gun owner to do in that situation?  Second, why in God’s name should the homeowner be charged with anything?  It’s clearly the police acting in a criminal manner, by bursting in unannounced in the wee hours of the morning.  Why do cops get a pass for these raids on the part of the public and the legal system?