It's a horror story that every witness in a crime case fears: Criminals find out your identity and murder you because you tried to do the right thing and help police solve a crime.

But for the family of David Henderson, 48, that horror story is made even worse by who leaked revealing information to his Denver killers. Local court officials mistakenly released secret court documents identifying Henderson's occupation and other important clues to a mother-and-son robbery team that he had informed on to police detectives, according to an Arapahoe County, Colorado criminal affidavit released Thursday.

On Oct. 12, 2016, Henderson, a car mechanic, was shot 10 times and killed in front of the Denver home where he lived with his mother. Prosecutors say the motive for the killing was Henderson's cooperation with detectives in describing details surrounding a marijuana shop robbery two months earlier.

“This is the nightmare scenario," Arapahoe County District Attorney George Brauchler said. The court system has taken the necessary steps and closed a loophole to make sure criminals don't get such documents again, according to Brauchler.

The robbers who court documents say orchestrated the execution-style hit, Terance Black, 26, and his mother, Tina Black, 51, were both sentenced to life without parole Thursday. But Henderson's family still feels the pain of the court mistake.

Henderson's sister said her family has struggled to recover. She described her brother as an easygoing man with a knack for car repairs who was afraid of retribution, but he still wanted to help, Karen Henderson said.

"He didn't have the proper protection," she said. "It's just a shame his life got taken for trying to do the right thing."

Prosecutors lauded Henderson's intentions.

“David Henderson is someone who’s to be commended for their guts and courage to come forward and do the right thing,” Brauchler said before the sentencing on Thursday.

Henderson had contacted police to report suspicious activity by Tina Black who had hired him to do mechanical work on her cars.

Police linked Henderson's information to the midday armed robbery at a suburban Denver marijuana store in August 2016. Prosecutors said Terance Black found out about Henderson's cooperation with police while he was out on bond for the robbery charges.

The Denver Post reported that discovery documents, which provided evidence in the robbery case, were erroneously mailed to someone in the investigation. That person called Terance Black and told him 'the mechanic' was talking to police, the Post reported.

Terance Black is quoted in the affidavit, saying that he "got the (court papers) of the guy telling . . . about the robbery."

Terance Black told a friend that he had read court papers that pointed to Henderson as a witness and that he "had been running his mouth . . . Terance Black said he read half of it and Mr. Henderson's name was 'all over it, telling,'" according to the criminal affidavit.

Terance Black told the acquaintance that if Henderson didn't show up to testify, "they didn't have a case," the affidavit says. "They could not prosecute them because Mr. Henderson was 'the witness.'" Black also said that "we're gonna have to kill him."

Both Terance and Tina Black were overheard at one point saying that Henderson "had been snitching and snitches get stitches," the affidavit said.

A spokesman for the Colorado courts system said the cause of the mistaken records release was fixed this summer after Brauchler's office notified administrators.

Spokesman Rob McCallum said in several districts, warrants signed by judges were automatically being released to all parties connected to a case including defendants and witnesses.

Officials estimated 1,500 cases were affected. Officials said they are not aware of any other case of a defendant accused of targeting or threatening witnesses based on mistakenly released court records.

The updated system, which was implemented in August, requires judges to specifically choose which parties receive those court files, McCallum said.

Contributing: Associated Press