And BTW, this all happens in the state of California
And that is why the state matters a lot. California does not have a crime of criminally negligent homicide. It has first and second degree murder, and involuntary and voluntary manslaughter. (I've left out the DUI related homicide offenses.)
Involuntary manslaughter occurs when the defendant kills another person without malice or an intent to kill but with conscious disregard for human life. Voluntary manslaughter occurs when the defendant kills another person in the heat of quarrel or passion (e.g. walking in on your spouse having sex with someone else and, in the heat of passion, killing your spouse's lover). Second degree murder is a willful killing of another that is not delibrate and premeditated; basically any murder that is not first degree murder. First degree murder is one that is willful, deliberate, or premediated and includes felony murder. Felony murder is when a death occurs while the defendant is committing certain specified felonies. While what you describe might fall under second degree murder, California provides two relevant defenses:
A. Where the defendant shoots someone who has forcibly entered his/her residence and the defendant shot the intruder knowing or having reasons to know the intruder entered forcibly and unlawfully. The problem with this defense is that it seems that it only justifies the killing of the intruder, not another occupant of the home. See Penal Code 198.5.
B. Homicide is also justified in the following circumstances:
(1) When resisting any attempt to murder any person, or to commit a felony, or to do some great bodily injury upon any person.
(2) When committed in defense of habitation, property, or person, against one who manifestly intends or endeavors, by violence or surprise, to commit a felony, or against one who manifestly intends and endeavors, in a violent, riotous, or tumultuous manner, to enter the habitation of another for the purpose of offering violence to any person therein.
(3) When committed in the lawful defense of such person, or of a spouse, parent, child, master, mistress, or servant of such person, when there is reasonable ground to apprehend a design to commit a felony or to do some great bodily injury, and imminent danger of such design being accomplished; but such person, or the person in whose behalf the defense was made, if he or she was the assailant or engaged in mutual combat, must really and in good faith have endeavored to decline any further struggle before the homicide was committed.
(4) When necessarily committed in attempting, by lawful ways and means, to apprehend any person for any felony committed, or in lawfully suppressing any riot, or in lawfully keeping and preserving the peace.
Penal Code 197. Arguably even though the person in your story accidentally hit the wrong person, the shooting would still be justified under one or more of the provisions I listed in B.
In short, I think the person here would have a better shot at avoiding conviction on some homicide related offense under California law than under the law of my state since it lacks a crime like criminally negligent homicide, which would be the more natural fit for this.