The reality TV show “Bait Car” is supposed to catch car thieves in the act.

Undercover cops park a rigged car on the side of the road, conspicuously leaving the keys inside, while a television crew waits nearby for an unsuspecting passerby to take the bait and steal the car.

But in one recent sting filmed in cooperation with the Los Angeles County Sheriff’s Department, the lead detective on the case ended up getting busted instead.

Footage shot for the TruTV program showed 28-year-old Keenan Alex come across a parked, shiny red Cadillac Escalade with the keys in the ignition and the engine running. After he gets inside and drives off, deputies pull him over and cuff him. In court, Det. Anthony Shapiro said under oath that he read Alex each of his Miranda rights from a card in his notebook before the suspect made incriminating statements, a transcript shows.

But unedited video for the program shows the detective never read the suspect his constitutional rights, including the right to remain silent and have an attorney present during questioning.

“You watch TV. You know your rights and all that?” Shapiro asked instead, according to the video reviewed by The Times.

After Shapiro’s conduct was discovered, prosecutors dropped the case against Alex and sheriff’s investigators launched a criminal perjury investigation of the detective, citing the conflict between his testimony and the video.

Combining law enforcement and reality TV has a long and sometimes controversial history, dating back to the long-running show “Cops.” While such programs often record the questionable behavior of suspects, the “Bait Car” case shows the unblinking eye of the camera can also catch potential police wrongdoing.

After reviewing the tape of Alex’s arrest, Deputy Dist. Atty. Christopher Frisco told a judge in February that Shapiro’s contradiction “poses a very severe problem,” according to court documents. Explaining why the D.A.'s office agreed to dismiss the case, Frisco said the footage showed that Shapiro had violated Alex’s Miranda rights, which prevented the prosecution from using the defendant’s incriminating statements. Frisco said prosecutors needed the statements to counter defense arguments that Alex’s mental illness played a role in the decision to take the vehicle.

“I believe the statement would be crucial to putting on the case to win a conviction,” Frisco told the judge, according to a court transcript.

Alex, whose criminal history includes brandishing a firearm and drug possession, admitted during a probation violation hearing for another case that he took the car. A judge allowed him to remain free as long as he continued taking his psychiatric medication and sought mental health treatment, records show.

Shapiro did not return messages for comment. His captain said the detective could not discuss the matter because it was the subject of an ongoing investigation. Sheriff’s spokesman Steve Whitmore said Shapiro has been relieved of duty with pay.

Court documents show Shapiro was almost fired in 2008 over allegations that he received stolen property from a known felon. Internal sheriff’s criminal investigators served Shapiro with a search warrant on his home and seized alloy car rims, a bicycle, a Honda generator and a Gibson electric guitar, court records show.

Shapiro denied the items were stolen, saying several came from his brother. Prosecutors declined to file charges, finding insufficient evidence the items were stolen. But after a separate investigation, the Sheriff’s Department, which requires a lower standard of proof to impose discipline, moved to fire Shapiro.

The detective appealed the decision, arguing there was no proof the items were stolen, court records show. The department agreed to classify the allegations as “unfounded,” while he agreed to a five-day suspension for using law enforcement records to check the criminal histories of two felons, including the man he was alleged to have received stolen property from and one of the detective’s neighbors, according to court records.

The department’s watchdog found serious flaws in the sheriff’s internal investigation. Investigators, including a deputy who had previously worked in the same unit with Shapiro, inadvertently tipped off the detective before executing their search warrant and allowed him to be present for an interview with a key witness, according to a 2010 report by the Office of Independent Review. The report found that “investigative deficiencies hampered a potential criminal prosecution and forced the department to continue to employ a deputy it believed had committed serious crimes.”

Shapiro’s attorney, Richard A. Shinee, disagreed. “There was no credible evidence that he stole anything, and that’s why the case fell apart,” he said. Shinee declined comment on the bait car case, citing the ongoing investigation.

During the “Bait Car” case, Alex’s defense attorney raised questions about whether the problems she encountered in her case were common in prosecutions resulting from the show.

Deputy Public Defender Priya Bala said she doubted the county was regularly turning over relevant video to defense attorneys, who may be able to use that footage to exonerate their clients. In her case, it took weeks before she was told the arrest had been filmed and an additional six months before the unedited footage was turned over, prompting the judge to rule that the county had failed to disclose evidence in a timely fashion.

The district attorney’s office initially said it could not compel the production company to turn over the footage but admitted it could when Bala obtained a copy of the county’s contract, which showed Earth Angel Productions had agreed to comply with district attorney requests for unedited footage. Part of the delay, Frisco said in court, was because Shapiro did not return repeated messages left by the prosecutor.

Deputy Dist. Atty. Alex Karkanen, who works with the auto-theft task force, said the county has prosecuted scores of similar bait car cases and never encountered such problems. Defense attorneys and judges, he said, are generally notified that the arrests were filmed for TV and the suspects are aware of the cameras and are asked to sign a waiver by the production crew at the time of their arrest.

Bala also criticized the county’s decision to conduct the televised stings at all, saying they wasted taxpayer resources that could better be used on more serious crimes. She said her client, who hallucinates and hears voices, jumped into the bait car while walking to an aunt’s house from a residential facility that houses the mentally ill.

“It’s disgusting,” she said. “Don’t they have any real crime to go after?”

Under its contract with the county Board of Supervisors, the production company pays the county at least $22,500 per episode, an additional 10% of the company’s profit from the series and other fees, as well as the overtime costs for law enforcement officers working on the stings. In July 2011, when Alex was arrested, the company paid $156,000 in overtime to deputies and police officers from other agencies assigned to the task force during that month, records show.

Whitmore, the sheriff’s spokesman, denied the payments are why the department does the stings, saying the televised operations act as a deterrent to car thieves.

“If the general public sees this [TV show], it’s going to prevent people from doing it because they won’t know if [a] car is a bait car or not,” he said.

robert.faturechi@latimes.com

jack.leonard@latimes.com