concurring in part and dissenting in part:
The State of California concluded that it had sentenced the petitioner in this case,
*849Ronald Taylor, too harshly. Although the State thought he was guilty of murder, the crime for which he had been convicted, it concluded that he was an aider and abettor and not a principal. The State made this determination because Taylor, after denying his guilt at trial, subsequently came clean about his involvement in the crime and fingered the likely principal in an effort to get a lighter sentence. The State eventually came to the same conclusion. Although it was under no obligation to do so, the State then laudably moved to give him that lighter sentence as an aider and abettor.
On Taylor’s petition for habeas corpus, the majority rules that the State may not resentence Taylor but must instead retry him or let him go. I expect that it may be difficult for the State to retry him successfully more than a quarter century after the crime was committed, for reasons having nothing to do with Taylor’s actual guilt or innocence. Thus, the result of our decision may well be to free Taylor and wipe this crime off his record. By punishing California for doing the right thing in reducing Taylor’s sentence, our decision will create a disincentive for states to correct prisoners’ sentences in similar situations in the future.
That result is both illogical and unwarranted under the law. I agree with the majority, albeit with some hesitation, that constitutional error arose when the State resentenced Taylor as an aider and abettor, given that the jury originally found that Taylor was the principal. But I disagree that the correct remedy is to grant the writ and order a retrial. Instead, I would hold that the error in this case is amenable to harmless error review, as is ordinarily the case when an error is discerned on habeas corpus review, and would remand to the district court for further proceedings to determine whether Taylor suffered prejudice.
I. Background
The following facts emerged at trial and, with one small exception noted below, are undisputed in the record before us. On November 19,1987, petitioner Ronald Taylor and another man stole a car with the intent to use it to commit a robbery. The two men drove to a Pioneer Chicken restaurant in Sunland, California. The first man entered the restaurant and requested the key to the lavatory from Rajinder Kaur, the attendant behind the counter. Kaur gave him the key, and the man went out of the restaurant to the lavatory, which was entered from the outside. The man kept the lavatory door ajar and watched until two customers drove off. The second man was sitting on the hood of the car in which the men had arrived.1
The first man then reentered the restaurant, walked behind the counter, and gave Kaur the key back with his left hand while pulling a gun from his pocket with his right. The second man had by then also entered the restaurant and was sitting in the dining area near the restaurant cook. The owner of the restaurant, Lewis Lim, came out of the kitchen. While the gunman was distracted by Lim, Kaur went through the kitchen door to summon help. The gunman then punched Lim and shot him through the head. As Kaur was trying to leave, the second man struck her on the back and threw her to the ground. *850The two men fled in the stolen car in which they had come. The ear was later found wiped down with brake fluid to remove fingerprints, but Taylor’s palm print was found on it.
Taylor was arrested and charged with murdering Lim in violation of California Penal Code § 187(a). The State also alleged three special circumstances. First, it alleged that Taylor committed the murder while engaged in the commission of a robbery in violation of Penal Code § 190.2(a)(17). Next, the State alleged that Taylor personally used a firearm during the crime. Third, the State alleged that a principal was armed with a firearm during the offense.
There was a dispute at trial whether Taylor, if he was present at all, was the shooter or the second man. The second man could be held guilty of murder under an aiding and abetting theory, and the jury was instructed on this theory. But, as the prosecutor acknowledged at the time, the jury could not properly find Taylor guilty of the § 190.2(a)(17) special circumstance on an aiding and abetting theory. Under California law, someone found guilty as “an actual killer” does not need to “have had any intent to kill at the time of the commission of the offense” for the special circumstance to be found true, but someone who aided and abetted the murder is subject to the special circumstance only if it is found that he acted with “the intent to kill.” Cal.Penal Code § 190.2(b), (c). The prosecutor conceded that he had not proven that the second man had the intent to kill Lim, so the jury could not convict Taylor of the special circumstance if it found Taylor was the second man. This made a difference for Taylor’s sentence: Taylor would only be eligible for life without parole or death if the jury found the special circumstance true. Cal.Penal Code § 190.2(a). Otherwise, Taylor would be eligible for a term of 25 years to life. CaLPenal Code § 190(a).
At trial, Taylor could not deny, in light of his palm print, that he had helped wipe down the stolen getaway car, but he otherwise tried to minimize his involvement. His attorney argued that he wasn’t “necessarily ... even there at the time of the robbery.” If he was there, the attorney argued, he was the second man, and he had no idea that the shooter planned to commit a robbery. Or, the attorney argued to the jury, the shootef might simply have wanted to execute Lim, not commit a robbery. If the jury believed this last theory, then even if it found that Taylor was the shooter, it could not convict Taylor of the first special circumstance, robbery murder.
In the face of the evidence against him, Taylor’s defense amounted to a high-risk gamble. Taylor lost. The jury found him guilty of first degree murder, attempted robbery, and the unlawful taking of a vehicle. The jury also found that the murder was committed while Taylor was engaged in an attempted robbery and that Taylor personally used a firearm.
After the verdict was rendered but before the sentence was imposed, Taylor told his lawyer that he was present during the robbery but that someone else was the shooter. Taylor filed a motion for new trial or, in the alternative, sought to strike the finding that he was the shooter and had personally used a firearm. The trial court denied that motion, and he was sentenced to life without parole. The verdict was upheld on appeal, and the California Supreme Court denied Taylor’s petition for review.
Seven years later, hoping that “somehow [he wouldn’t] die in prison,” Taylor tried again to convince the State that he had not been the actual killer, identifying his cousin, Hugh Hayes, Jr., as the shooter. The Los Angeles Police Department and Los *851Angeles County District Attorney’s Office concluded that was true, and the district attorney’s office filed an information charging Hayes with murder. Taylor testified at Hayes’s preliminary hearing that he and Hayes stole the ear and drove around with a loaded gun looking for a place to rob, and that he had been with Hayes at the Pioneer Chicken during the attempted robbery. In 1999, Hayes was tried for the murder but was acquitted. There was, therefore, no adjudication inconsistent with the jury verdict finding that Taylor was the actual shooter. Nonetheless, that same year, the district attorney attempted to have Taylor’s sentence recalled but failed.
Even though the State had not managed to convict the man it thought was the actual killer, the district attorney still supported the effort to reduce Taylor’s sentence. In 2006, the California Supreme Court issued an order to show cause why Taylor should not be resentenced. The State agreed that Taylor should be resentenced, and Taylor was resentenced to 25 years to life as an aider and abettor, plus an additional six years for his prior prison time and felony record.
In 2008, after the resentencing and an unsuccessful appeal, Taylor filed another habeas corpus petition with the California Supreme Court. Taylor’s argument was that the jury had already found factually that he was not the aider and abettor in Lim’s murder; because it had determined that he was the principal, so he could not be sentenced and held as an aider and abettor. The petition was summarily denied.
Taylor filed a habeas petition in federal district court. The district court, following the magistrate judge’s recommendation, denied relief. But the majority has now accepted Taylor’s argument and has ordered the writ to be granted, requiring the State either to retry Taylor or free him.
II. Discussion
As discussed in detail below, our opinion here leads to a result that seems to me strange and even a bit perverse. The evidence that Taylor aided and abetted murder was very strong. It seems unlikely that he has actually been prejudiced. Yet, the majority’s remedy may well lead to Taylor being freed and the conviction wiped from his record. At a minimum, it imposes on the State the burden of trying to convict Taylor of a crime committed long ago, following a fair trial in which he could have been honest about his role but instead gambled for a full acquittal and lost. Moreover, this case has only arisen because California moved to resentence Taylor. Otherwise, Taylor would have had no basis for obtaining the writ. We should not punish California for doing the right thing, nor should we create an incentive for states in the future to avoid doing the right thing.
In my view, this case does not- represent the kind of “extreme malfunction[ ] in [a] state criminal justice system[ ]” that may justify granting federal habeas relief. Harrington v. Richter, 562 U.S. 86, 131 S.Ct. 770, 786, 178 L.Ed.2d 624 (2011) (quoting Jackson v. Virginia, 443 U.S. 307, 332, n. 5, 99 S.Ct. 2781, 61 L.Ed.2d 560 (1979) (Stevens, J., concurring in judgment)). There is no malfunction of any kind, let alone an extreme one, when a state voluntarily moves to resentence a prisoner in response to that prisoner’s belated confession.
It does not have to be like this. The Sixth and Fourteenth Amendments do not compel this illogical result.
*852 A. The Sixth Amendment violation
Although the issue is not free from doubt, I agree with the majority that there. has been a Sixth Amendment violation in this case. This violation stems from California's resentencing of Taylor under an aiding and abetting theory when the jury did not find all the “elements” of aiding and abetting. See Apprendi v. New Jersey, 530 U.S. 466, 477, 120 S.Ct. 2348, 147 L.Ed.2d 435 (2000) (reaffirming that a criminal defendant is entitled to “a jury determination that [he] is guilty of every element of the crime with which he is charged, beyond a reasonable doubt” (quoting United States v. Gaudin, 515 U.S. 506, 510, 115 S.Ct. 2310, 132 L.Ed.2d 444 (1995)) (emphasis added)). I therefore concur in part with the majority.
I say that the issue is not free from doubt, however, because the federal courts have declined to treat the “elements” of aiding and abetting liability like the elements of a crime for all purposes. It is not Apprendi error to fail to allege the elements of aiding and abetting in an indictment. See, e.g., United States v. Sckuh, 289 F.3d 968, 976 (7th Cir.2002). This is because aiding and abetting is not itself a substantive offense. See United States v. Armstrong, 909 F.2d 1238, 1241 (9th Cir.1990). Rather, aiding and abetting is only a theory of criminal liability and does not have elements.
Normally, the failure of a jury to “find” a particular theory is not an issue that arises on appellate review. Jurors need not agree on a single theory of liability. Schad v. Arizona, 501 U.S. 624, 645, 111 S.Ct. 2491, 115 L.Ed.2d 555 (1991). And jurors are presumed to be capable of determining which theory of liability, if any, fits the facts of a particular case. Griffin v. United States, 502 U.S. 46, 59, 112 S.Ct. 466, 116 L.Ed.2d 371 (1991). The issue of whether a jury has “found” a theory is usually not a question for an appellate court.
Nevertheless, I am persuaded' that, in this unusual case, the failure of the jury to convict Taylor on an aiding and abetting theory should be treated like the failure of a jury to find an element of a crime. As the majority points out, we know that the jury settled on a theory that Taylor was the shooter, not an aider and abettor. We have previously considered the failure of a jury to find the elements of aiding and abetting liability as similar to the failure to find the elements of a crime. See, e.g., Martinez v. Borg, 937 F.2d 422, 423 (9th Cir.1991) (holding that “Beeman error is constitutional error because the jury did not have the opportunity to find each element of the crime beyond a reasonable doubt,” and going on to apply harmless error review) (citing People v. Beeman, 35 Cal.3d 547, 199 CaLRptr. 60, 674 P.2d 1318 (1984)). Therefore, I agree that there is a constitutional violation in this case.
B. The proper remedy
I respectfully disagree with the majority, however, that the correct remedy for this constitutional violation is the granting of the writ. This resentencing error flowed directly from an inadvertent error by the State at Taylor’s trial, as well as from Taylor’s high-risk defense gamble. We should therefore consider whether this error, like other trial errors, is amenable to review for harmless error.
When a prisoner challenges his sentence or conviction on collateral attack in federal court, and the court concludes that his constitutional rights have been infringed, the error falls into one of two categories. Only a “very limited” number of constitutional errors are deemed “structural” and require automatic reversal. Johnson v. United States, 520 U.S. 461, 468, 117 S.Ct. 1544, 137 L.Ed.2d 718 (1997). These in-*853elude grave defects tainting the entire process, such as a biased judge or the total deprivation of the right to counsel. See id. at 468-69, 117 S.Ct. 1544 (citing Gideon v. Wainwright, 372 U.S. 335, 83 S.Ct. 792, 9 L.Ed.2d 799 (1963), and Tumey v. Ohio, 273 U.S. 510, 47 S.Ct. 437, 71 L.Ed. 749 (1927)). If the error does not fall into this very limited category, it is a “trial error” and is subject 'to harmlessness analysis, whereby the court is required to determine whether the error had a “substantial and injurious effect or influence in determining the jury’s verdict.” Brecht v. Abrahamson, 507 U.S. 619, 631, 113 S.Ct. 1710, 123 L.Ed.2d 353 (1993) (quoting Kotteakos v. United States, 328 U.S. 750, 776, 66 S.Ct. 1239, 90 L.Ed. 1557 (1946)). See generally Arizona v. Fulminante, 499 U.S. 279, 306-12, 111 S.Ct. 1246, 113 L.Ed.2d 302 (1991) (dividing errors into “structural defects” and “trial errors”).
' A “trial error” is an “error which occurred during the presentation of the case to the jury, and which may therefore be quantitatively assessed in the context of other evidence presented in order to determine whether its admission was harmless beyond a reasonable doubt.” Fulminante, 499 U.S. at 307-08, 111 S.Ct. 1246. It is clear that, even though Taylor’s trial was fair, there was an “error” in the presentation of the case to the jury. The State presented a theory that turned out to be wrong. This theory led the jury wrongly to find that Taylor was the actual shooter.
That was a result that everyone today agrees was incorrect. If the State had not argued to the jury that Taylor was the shooter, the jury would not have found that he was. I therefore disagree with the majority that “[tjhere was no trial error that could be subject to harmless error analysis.” Maj. op. at 848. The trial error was that the State presented a theory that turned out to be wrong.
The only reason the majority reaches the conclusion that this was not a “trial error” is that the State was not aware of its error at the time. See Maj. op. at 847 (“The actual identity of the shooter was not known to the prosecutor during trial.”). But this does not make a difference in distinguishing between trial errors and structural defects. For that purpose, an error is an error, regardless of whether someone is aware of it or not. The error was no more “structural” because it was unknowingly committed.
The majority assumes, in effect, that the error was structural because it does not fit neatly into an established category of trial error. That is backwards. It is the category of structural errors that is the exception, not the rule.
Suppose, in contrast to the actual facts here, the prosecutor had actually known that Taylor was not the actual shooter but argued and presented evidence to that effect to the jury anyway. That would be trial error subject to harmless error review. We have held that it is not structural error for a prosecutor knowingly to put a false theory to a jury. Hayes v. Brown, 399 F.3d 972, 984 (9th Cir.2005) (en banc). That kind of behavior by the prosecutor— described by us in Hayes as “pernicious” and surely worse than what happened here — would be considered a trial error and would not lead to an automatic reversal. Id. at 981 (quoting Willhoite v. Vasquez, 921 F.2d 247, 251 (9th Cir.1990) (Trott, J., concurring)).
But because the State did not knowingly present a factually false theory in this case — did not act perniciously here — the majority concludes that the error here was structural and does require an automatic reversal, without requiring Taylor to demonstrate actual prejudice. That result is counterintuitive, as well as at odds with precedent. It makes no sense to disre*854gard the customary requirement for actual prejudice because the State unknowingly presented a false theory at trial. Logic compels that we conclude that the error in this case was a trial error.
Supreme Court precedent also leads to this conclusion. The Court has established that, even on direct review, a failure by the jury to find an element of a crime is susceptible to harmless error analysis. Neder v. United States, 527 U.S. 1, 11, 119 S.Ct. 1827, 144 L.Ed.2d 35 (1999). The failure of the jury to find the “elements” of aiding and abetting should not render the resentencing error structural, as the majority concludes.
The majority’s approach is all the weaker because, unlike Neder, this case is on collateral and not direct review. As noted above, we have the power to grant the writ only as a “guard against extreme malfunctions in the state criminal justice systems.” Richter, 131 S.Ct. at 786 (quoting Jackson, 443 U.S. at' 332 n. 5, 99 S.Ct. 2781 (Stevens, J., concurring in judgment)). And there is no malfunction when the State willingly chooses to reduce a prisoner’s sentence on account of his tardy confession.
There is analogous precedent from the Supreme Court on which we should rely. The case most similar to this situation is Hedgpeth v. Pulido, 555 U.S. 57, 129 S.Ct. 530, 172 L.Ed.2d 388 (2008) (per curiam). California prosecuted Pulido for the same crime as here, aiding and abetting felony murder. The State presented two inconsistent theories: first, that Pulido formed the intent to aid and abet the underlying felony before the murder; and second, that he formed the necessary intent after the murder. Pulido, 555 U.S. at 59, 129 S.Ct. 530. Under California law, the second theory was invalid.
On habeas review, our court held that the error was structural. Pulido v. Chrones, 487 F.3d 669 (9th Cir.2007) (per curiam). The Supreme Court reversed us. Even though one of the theories of aiding and abetting was invalid as a matter of law, harmless error review still applied.
Here, as in Pulido, the State put forward two mutually inconsistent theories of the defendant’s guilt: that Taylor was the shooter or that he was the second man. We know that the jury adopted one of these theories, that he was the actual shooter, and implicitly rejected the other. The Supreme Court reversed us in Pulido because it would be “patently illogical” to “draw[ ] a distinction between alternative-theory error and the instructional error[ ] in Neder.” 555 U.S. at 61, 129 S.Ct. 530 (internal quotation marks omitted). All that separates this case from Pulido is that one of the theories here was wrong as a matter of fact, not of law.
When a jury errs by accepting an incorrect legal theory, we apply harmless error review. In this rare situation when we know that the prosecutor caused the jury to credit the wrong evidence, there is no reason to apply a more stringent standard.
Comparing this ease to trial error cases is enough to show that the error in this case should be subject to harmlessness review. Comparing this situation to structural errors leads to the same result. In fact, because structural defects are “the exception and not the rule,” the majority should bear the burden of explaining why the resentencing error in this case warrants automatic reversal. Pulido, 555 U.S. at 61, 129 S.Ct. 530. It cannot do so.
The Supreme Court has held that an error is structural when it “necessarily render[s] a trial fundamentally unfair” and “vitiates all the jury’s findings.” Neder, 527 U.S. at 11, 119 S.Ct. 1827 (quoting Rose v. Clark, 478 U.S. 570, 577, 106 S.Ct. 3101, 92 L.Ed.2d 460 (1986), and Sullivan *855v. Louisiana, 508 U.S. 275, 281, 113 S.Ct. 2078, 124 L.Ed.2d 182 (1993)). Taylor’s trial and resentencing were fair. The jury’s most important findings remained intact, even considering Taylor’s revised, post-conviction version of events. It is hard to see the “fundamental unfairness” of a trial process where the defendant gambles on being acquitted, the jury convicts him of a crime in which he is indisputably involved, and the State then invests considerable effort to reduce his sentence in response to the defendant’s post-trial admissions.
California’s decision to give Taylor the benefit of his belated confession did not “vitiate all the jury’s findings.” The most important findings stand: Taylor was present at the scene of the crime and was involved in an attempted robbery in which Lim was murdered. The only finding that is vitiated is that Taylor pulled the trigger. This is far short of what is required for us to find structural error.
C. The consequences of the majority’s remedy
As noted above, to obtain habeas relief in federal court a petitioner must ordinarily demonstrate that the error had a “substantial and injurious effect or influence in determining the jury’s verdict.” Brecht, 507 U.S. at 631, 113 S.Ct. 1710. By concluding that the error here was structural, the majority opinion relieves Taylor of that burden; That probably makes a critical difference. I would remand to the district court for the parties to address that question and for the district court to make a factual determination. Based on the record as it appears to me at this point, however, the evidence against Taylor appeared strong, and I think it would be an uphill climb for him to make that showing.
Under California law, an aider and abettor must “share the specific intent of the perpetrator” of a crime in order to be found guilty. Beeman, 199 Cal.Rptr. 60, 674 P.2d at 1326. In this case, Taylor would be guilty of aiding and abetting felony murder if he knew that the gunman entered Pioneer Chicken in order to rob it. It is doubtful that the jury would have concluded otherwise. Indeed, Taylor has since admitted that he and the gunman intended to rob a fast food restaurant that day and stole a car for that purpose. He admitted that they had robbed five or six restaurants in the previous month. Taylor’s sole defense would presumably be that he didn’t know that Hayes was planning to rob that particular restaurant. This seems extraordinarily weak, and the proposition that he could have persuaded the jury that his companion did not intend to rob the Pioneer Chicken seems fanciful. At oral argument before us, Taylor’s counsel conceded that the argument that he was not planning to rob the Pioneer Chicken was flimsy. We should not pretend otherwise.2
But retrying Taylor at this point would not be easy. The killing took place in 1987, more than a quarter century ago. Witnesses lose their memories, disappear, or die. Even with Taylor’s testimony, *856Hayes was-acquitted by a jury when he was tried years after the events. In addition, Taylor could have an argument that a retrial on an aiding and abetting theory would be barred under the Double Jeopardy Clause. See, e.g., Ashe v. Swenson, 397 U.S. 436, 90 S.Ct. 1189, 25 L.Ed.2d 469 (1970); Santamaria v. Horsley, 133 F.3d 1242 (9th Cir.1998) (en banc). Taylor’s counsel has understandably been quiet about this argument, responding to inquiry at oral argument by saying only that the question is not currently before this court. At a minimum, the majority opinion imposes on the State the burden of trying to convict Taylor of a crime committed long ago, following a fair trial in which he had could have been honest about his role but instead gambled for a full acquittal and lost.
This result is all the more bizarre considering how this case comes before us. Taylor objects that the State committed error in his resentencing. If California had not moved to resentence him, this case would not be here. Taylor’s only option would be to plead that, contrary to the jury verdict, he was actually innocent of the personal use of a firearm special circumstance. But. this claim, without any supporting constitutional challenge, would likely fail. See Herrera v. Collins, 506 U.S. 390, 404-05, 113 S.Ct. 853, 122 L.Ed.2d 203 (1993).
To avoid all of this, the State could simply have declined to resentence Taylor. But we should be glad that it did. It would have been wrong for the State to hold Taylor on a theory of personal liability when it sought to cbnvict Hayes under the same theory. “[Tjhere is surely something troubling about having the same sovereign, particularly acting through the same prosecutor, urge upon two juries a conviction of both A and B, when it is clear that the crime was committed by either A or B.” Thompson v. Calderon, 120 F.3d 1045, 1070 (9th Cir.1997) (en banc) (Kozinski, J., dissenting), rev’d, 523 U.S. 538, 118 S.Ct. 1489, 140 L.Ed.2d 728 (1998).
We should not punish the State of California for doing the right thing in this case by forcing it to retry Taylor or free him. Neither should we discourage other prosecutors from doing the right thing in the future. Justice is not served by the result reached here.
I respectfully dissent.
. This is the small exception. During a subsequent preliminary hearing in connection with charges brought against Hugh Hayes, Jr., the person Taylor eventually identified as the actual shooter, Taylor stated that the second man (who Taylor had by then confessed was himself) sat in the car. Wherever the second man was sitting, he was able to see the lavatory, so the difference appears immaterial.
. Moreover, the crime underlying the felony murder, attempted robbery, may have been complete as soon as the gunman went into the lavatory to case the joint. In California, attempt may consist of "a direct but ineffectual act” done toward the commission of a crime. Cal. Jury Instr. 6.00; see, e.g., People v. Dillon, 34 Cal.3d 441, 194 Cal.Rptr. 390, 668 P.2d 697, 704 (1983) (substantial evidence supported the jury's finding that the defendant committed attempted robbery, where the defendant and his companions "watched for their opportunity” to rob a marijuana field without entering it). There was testimony in the first trial that Taylor watched the gunman go into the lavatory and keep the door ajar, so he would have known that the gunman planned a robbery.