DALLAS (CBSDFW.COM) – Years before the Odessa-Midland gunman went on a rampage that left seven dead and 25 injured, he was blocked from getting a gun.

In 2014, the gunman failed a background check due to “mental health issues,” according to law enforcement.

READ MORE: COVID-19 Omicron Variant Arrives In Texas

However, a loophole in the system meant his failed attempt to purchase a firearm was likely never investigated by law enforcement.

He later bypassed a background check by purchasing firearms from a private seller.

Every year thousands of people in Texas lie on a background form to try to buy a gun.

Some lie about their mental health. Others lie about their criminal record.

It is a felony to lie on a gun form but the crime is rarely punished.

A CBS 11 I-Team investigation found in the 100 counties that make up the Northern District of Texas, in the past five years, only nine people were prosecuted for providing a false statement on a gun form.

In December 2016, Steven Boehle walked into an Austin-area gun store and attempted to buy a semi-automatic rifle.

Michael Cargill, the owner of Central Texas Gun Works, handed Boehle a “Firearms Transaction Record” (ATF Form 4473) and told him to fill it out.

On the question asking whether you have ever been convicted of domestic violence, Boehle marked “no.”

That was a lie.

Boehle was convicted of misdemeanor domestic violence assault in Connecticut in 1993. That conviction banned him from purchasing a firearm.

Cargill entered Boehle’s application into the National Instant Criminal Background Check System (NICS) and his application was denied.

“You are not going to eliminate evil but what we can do is make sure we can do what we are supposed to do and to make sure firearms are not into the wrong hands,” Cargill said.

Michael Cargill – Central Texas Gun Works (CBS 11)

But while Cargill did his job, he said law enforcement failed to theirs.

This was not the first time Boehle had lied on a gun background form. He lied on three different occasions but every time nothing happened to him.

Four months after Boehle’s gun application was denied, the FBI received a tip about him plotting a mass shooting.

READ MORE: 'My Home Is Still Uninhabitable': 10 Months After Winter Storm Some Texans Still Waiting On Insurance Claims

A search warrant of Boehle’s home found 13 guns, more than 1,100 rounds of ammunition, and a hand-written note.

Federal agents testified they believe Boehle wanted to celebrate his 50th birthday with a mass shooting.

Boehle pleaded guilty to unlawful possession of a firearm, agreed to surrender his firearms, and was sentenced to five years probation.

Steven Boehle

Cargill said Boehle’s case should have never gotten that far. He said law enforcement should have investigated Boehle months prior when he lied on gun form.

But the CBS 11 I-Team found law enforcement rarely investigates denied gun applications.

According to a federal government audit, in 2017 more than 112,090 gun applications were denied of which the Bureau of Alcohol, Tobacco, Firearms, and Explosives (ATF) referred 12,710 to its field divisions for further investigation. However, only 12 of those cases nationwide were ever prosecuted.

According to an I-Team analysis using court records collected by the Transactional Records Access Clearinghouse (TRAC), in the Northern District of Texas one case of providing a false statement to acquire a firearm was prosecuted in 2017 and four cases in 2018.

The ATF said it does not have the resources to investigate every denied application.

This is why 13 states have started investigating these cases themselves. Texas is not one of them.

For the past two sessions, State Representative Gina Hinojosa, D-Austin, has filed a bill that would ensure local law enforcement is notified when someone lies on a gun background form.

Her bill would also give local district attorneys the authority to prosecute these cases.

But both times her bill failed to even be brought up for a vote in committee.

“My fear is that this will keep happening and we will miss opportunities to catch someone,” Hinojosa said. “It makes me angry. We can pass laws that make us safe, especially laws that don’t effect law abiding Texans. I see no reason why we shouldn’t be doing this.”

State Rep. Gina Hinojosa speaks with CBS 11’s Brian New (CBS 11)

A federal bill has been filed that would require the FBI to alert local law enforcement within 24 hours of someone failing a gun background check.

The bill has bipartisan support but it does not include the funding many say is needed for it to be effective.

Gun rights advocates have also raised concern about the accuracy of NICS, the national database used for these background checks.

MORE NEWS: Quarterback Josh Hoover Of Rockwall-Heath High School Wins 2021 Landry Award

Over the years, there has been a number of denials that were false positives because of inaccurate information in the system.