FORT WAYNE, Ind. — At a federal courthouse in Tennessee, a judge signed an order allowing an ailing inmate to go home.

But he died in a prison hospice before he heard the news.

At his wife’s home in Indiana, as she was getting a wheelchair, bedpans and other medical equipment ready for his arrival, the phone rang.

“It was the chaplain,” said the wife, Marie Dianne Cheatham. “He said, ‘I’m sorry to have to tell you.’ And my heart fell through the floor. I knew what he was going to say.”

For years, terminally ill federal prisoners like Ms. Cheatham’s husband, Steve, have in theory had the option of what is called compassionate release. But in practice, the Bureau of Prisons would often decline to grant it, allowing hundreds of petitioners to die in custody. One of the provisions of the new criminal justice law, signed by President Trump on Dec. 21, sought to change that, giving inmates the ability to appeal directly to the courts.