Appeal by the defendant from a judgment of the Supreme Court, Kings County (Kramer, J.), rendered August 6, 1987, convicting him of criminal sale of a controlled substance in the first degree, criminal possession of a controlled substance in the second degree, and criminal possession of a controlled substance in the third degree, upon a jury verdict, and imposing sentence.
Ordered that the judgment is reversed, on the law, and a new trial is ordered. No questions of fact have been raised or considered.
The defendant contends that the evidence adduced at trial was legally insufficient to support the judgment of conviction. We disagree. Viewing the evidence in the light most favorable to the prosecution (see, People v Contes, 60 NY2d 620), we find that it was legally sufficient to establish beyond a reasonable doubt that the defendant, along with several others, knowingly and unlawfully possessed and sold a large quantity of cocaine (see, Penal Law § 220.43 [1]; § 220.18 [1]; § 220.16 [1]).
However, reversal of the judgment of conviction is warranted due to the trial court’s erroneous Sandoval ruling. Over defense counsel’s strenuous objection, the court granted the prosecutor permission to cross-examine the defendant, in the event that he chose to testify, as to whether, on an earlier occasion, he had been found in possession of a quantity of crack cocaine. This ruling was made despite evidence before the court indicating that at that time the defendant had been stopped by the police while driving in his livery cab. A *490passenger in the vehicle acknowledged ownership of the drugs, and the defendant was released without being charged with a crime. The basis for the ruling was explained later in the proceedings, when it became clear that the court had been acting under the misapprehension, brought about by its refusal to read some papers proffered by defense counsel, that the defendant was "the unindicted co-conspirator” in the earlier case. Unfortunately, the court did not change its prior ruling after being made aware of the actual circumstances surrounding the prior arrest. The court’s ruling was error, as it is clear from the record that the People failed to establish "a reasonable basis in fact for the allegations [of the defendant’s complicity in a previous drug transaction] and a good-faith basis for making the inquiry” (People v Hernandez, 127 AD2d 790, 791; accord, People v De Pasquale, 54 NY2d 693; People v Greer, 42 NY2d 170, 176). Moreover, under the circumstances of this case, where the defendant claimed to have been an innocent bystander and the evidence adduced against him was less than overwhelming, the trial court’s ruling cannot be considered harmless (see, People v Crimmins, 36 NY2d 230; cf., People v Hernandez, 127 AD2d 790, supra).
In light of the foregoing, we decline to address the defendant’s remaining contentions, including those raised in his supplemental pro se brief. Thompson, J. P., Brown, Harwood and Balletta, JJ., concur.