One of two people accused of killing a 71-year-old film scout and photographer on San Francisco’s Twin Peaks last month had been arrested days earlier in the city for allegedly being a felon in possession of a gun, but was released from jail through a pretrial diversion program, records show.

City officials are now questioning the release of Lamonte Mims, a 19-year-old former resident of Patterson (Stanislaus County), who was on probation for burglarizing cars on Twin Peaks.

Mims was booked Monday and appeared in Superior Court on Tuesday to face charges including murder in the July 16 shooting of the film scout, Edward French, which occurred in the early morning during an apparent robbery attempt. A second suspect, 20-year-old Fantasy Decuir of San Francisco, did not appear in court after being hospitalized for an undisclosed reason, Assistant District Attorney Michael Swart said in court.

Defense attorney Randall Knox, who was appointed to represent Mims, and Public Defender Jeff Adachi, who is representing Decuir, declined to comment outside court.

Swart said there is video evidence that Decuir pulled the trigger and that Mims, who had been barred from Twin Peaks by a court order, “made admissions of robbing French of his belongings” to police.

Mims was previously arrested July 7 on suspicion of being a felon with a gun, according to court documents, and appeared in court July 11. Investigators reported finding him July 4 in a car on Fitzgerald Avenue, along with another man, a 9mm Ruger pistol and a .38-caliber revolver — an alleged violation of his probation.

Mims had been arrested in November on suspicion of committing three car break-ins on Twin Peaks and possessing burglary tools. On March 28, records show, he pleaded guilty to burglary and receiving stolen property, both misdemeanors. He was sentenced to three years of probation and a 90-day suspended sentence.

The district attorney’s office moved to revoke his probation July 11, but a judge ruled he should be released on what is known as assertive case management, a pretrial program that requires routine check-ins. The judge had followed a recommendation by the San Francisco Pretrial Diversion Project, a nonprofit group funded by the sheriff’s department and the mayor’s office.

In May 2016, San Francisco began experimenting with a computer algorithm that seeks to improve on the system of setting bail based on alleged crimes, taking into consideration whether a defendant might pose a public safety or flight risk.

The risk-assessment tool, developed by the Texas-based Laura and John Arnold Foundation, weighs a number of factors including the pending charges, the person’s age and rap sheet, and their record of showing up to court. The tool then makes a recommendation for or against release, which is sent to a judge who can follow or ignore the advice.

Though District Attorney George Gascón was a proponent of the tool, prosecutors and defense attorneys said they have seen assessments with which they did not agree. Alex Bastian, a spokesman for the district attorney’s office, said Tuesday there have been “many instances of contention.”

“As it relates to this case along with many other cases, we have a disagreement with how that risk assessment is being calculated,” Bastian said. “They suggested release with certain conditions, and the judge carried out that recommendation and this defendant was released.”

The Pretrial Diversion Project and the Arnold Foundation did not immediately return requests for comment Tuesday.

In addition to the San Francisco offenses, Mims was on felony probation in San Mateo County. He pleaded no contest to felony car burglary and misdemeanor identity theft on July 21, 2016, said San Mateo County District Attorney Steve Wagstaffe.

His arrest at Twin Peaks in November was a violation of Mims’ probation in San Mateo County, and he returned to court there in January, Wagstaffe said. Mims admitted the probation violation on Jan. 20, Wagstaffe said, and was sentenced to six months in jail. He served three months, with another three months of credit for good behavior.

San Francisco police said they linked Decuir and Mims to French’s killing while investigating a separate armed robbery that occurred near the Cathedral of St. Mary of the Assumption at Geary and Gough streets on the morning of July 28. A 53-year-old man and a 33-year-old woman had been robbed of their cameras and wallets at gunpoint.

In court Tuesday, Swart argued against Judge Donna Hitchens’ decision to set bail for Mims and Decuir at $5 million, calling it “an insult.” He asked for $10 million, citing Mims’ prior convictions and the murder charges against them. Hitchens kept the bail at $5 million.

Vivian Ho is a San Francisco Chronicle staff writer. Email: vho@sfchronicle.com Twitter: @VivianHo