California does not allow a felony murder charge when a co-perpetrator is killed by a victim or bystander
CALIFORNIA — Not allowing a felony murder charge when a co-perpetrator is killed is established in case law.
All murder which is perpetrated by means of a destructive device or explosive, a weapon of mass destruction, knowing use of ammunition designed primarily to penetrate metal or armor, poison, lying in wait, torture, or by any other kind of willful, deliberate, and premeditated killing, or which is committed in the perpetration of, or attempt to perpetrate, arson, rape, carjacking, robbery, burglary, mayhem, kidnapping, train wrecking, or any act punishable under Section 206, 286, 288, 288a, or 289, or any murder which is perpetrated by means of discharging a firearm from a motor vehicle, intentionally at another person outside of the vehicle with the intent to inflict death, is murder of the first degree. All other kinds of murders are of the second degree.
Case law that establishes this in California
CASE LAW — PEOPLE v. WASHINGTON
 When a killing is not committed by a robber or by his accomplice but by his victim, malice aforethought is not attributable to the robber, for the killing is not committed by him in the perpetration or attempt to perpetrate robbery. It is not enough that the killing was a risk reasonably to be foreseen and that the robbery might therefore be regarded as a proximate cause of the killing.  Section 189 requires that the felon or his accomplice commit the killing, for if he does not, the killing is not committed to perpetrate the felony. Indeed, in the present case the killing was committed to thwart a felony. To include such killings within section 189 would expand the meaning of the words “murder … which is committed in the perpetration … [of] robbery …” beyond common understanding.
 The purpose of the felony-murder rule is to deter felons from killing negligently or accidentally by holding them strictly responsible for killings they commit. (See Holmes, The Common Law, pp. 58-59; Model Penal Code (Tent. Draft No. 9, May 8, 1959) § 201.2, comment 4 at pp. 37-38; Report of the Royal Commission on Capital Punishment, Cmd. No. 8932, at pp. 35-36 (1949-1953).) This purpose is not served by punishing them for killings committed by their victims.
 It is contended, however, that another purpose of the felony-murder rule is to prevent the commission of robberies. Neither the common-law rationale of the rule nor the Penal Code supports this contention. In every robbery there is a possibility that the victim will resist and kill. The robber has little control over such a killing once the robbery is undertaken as this case demonstrates. To impose an additional penalty for the killing would discriminate between robbers, not on the basis of any difference in their own conduct, but solely on the basis of the response by others that the robber’s conduct happened to induce. An additional penalty for a homicide committed by the victim would deter robbery haphazardly at best. To “prevent stealing, [the law] would do better to hang one thief in every thousand by lot.” (Holmes, The Common Law, p. 58.)
Link to the California Statute — HERE
Link to the California Case Law — HERE