Yuchen Lei, a Chinese doctoral student at Texas A&M, found not guilty by reason of insanity for stabbing of a College Station Medical Center nurse in 2014, sat in a Brazos County jail cell for 115 days.

A KAGS investigation has learned that, after being ordered to be evaluated at a Texas maximum security state hospital, Lei waited for a bed in one of those facilities for just under 4 months.

That time period fails to comply with a Texas law that says offenders who are not guilty by reason of insanity are to be sent to a state hospital in a timely manner and sent back to county jails after a no more than a 30 day evaluation.

Lei's lawyer, Shane Phelps, says it was a violation of his client's constitutional rights.

"People who are accused of offenses, people who are held in custody by the state, have a right to expect, as does any citizen, that we will follow our own laws. And in this case, we did not," said Phelps. "And it happens all over Texas in these kinds of cases."

In Texas law, if you don't know what you're doing is wrong, you can be found not guilty by reason of insanity. That means, you technically did not commit the crime, and thus aren't supposed to serve jail time.

However, KAGS has learned that, according to the Texas Health and Human Services Commission, there are approximately 345 people waiting to enter state maximum security mental health facilities, most waiting in county jails. Also, the average wait to enter a maximum security state hospital is 142 days.

Many who are technically innocent sit in county jails waiting to be sent for mental health evaluation or treatment.

But, while the state mandates that counties send these kinds of offenders to maximum security hospitals, there are only two maximum security mental health facilities in the entire state: one fully max facility at North Texas State Hospital's Vernon Campus, and a maximum security wing at the Rusk State Hospital.

Brazos County Sheriff Chris Kirk says that Lei waited in jail for a bed to open at the Vernon State Hospital.

"It's very difficult to get a bed in there. So, he actually waited for 115 days in our custody until he got a bed in that facility," said Sheriff Kirk.

Sheriff Kirk also said he knows of two other cases where prisoners have waited in the Brazos County Jail for openings at state mental health facilities. "It is a common thing for us and it is across the state, as well," said Sheriff Kirk.

"It's really a Catch 22," says Brazos County Assistant District Attorney Jessica Escue. "You can't release a defendant until that evaluation is made, but at the same time, [the state] tell[s] you an unrealistic deadline."

Phelps told KAGS that it was difficult to explain to his client, who left China to study in the U.S., that counties in Texas weren't following this law to the letter.

"My client asked me 'but it says in black and white they can't hold me?' And, I [had] to say, 'I'm sorry,'" said Phelps. He added, "we're a nation of laws, but we're not following these laws."