Funnyman Jeff Ross may have inadvertently contributed to a Texas inmate’s death sentence … and now, the guy’s attorneys are asking the Supreme Court to overturn the sentence.

Here’s the rub … attorneys for Gabriel Hall are petitioning the U.S. Supreme Court to review the convicted killer’s capital punishment sentence, which was based in part on jokes Ross and Hall made to each other … during the comedian’s 2015 TV special.

During the trial, prosecutors used Ross’ show as evidence against Hall, which eventually lead to his conviction and subsequent death sentence.

The taped special was shot at the Detention Center where Hall was awaiting trial in TX back in ’15 … it was filmed shortly before Hall’s conviction for the murder of a man named Edwin Shaar.

According to the Supreme Court petition, obtained by TMZ, Ross and Hall had a wide-ranging convo that was aired AS A PART of “Jeff Ross Roasts Criminals: Live At Brazos County Jail.”

The chat lasted 17 minutes with the comedian repeatedly mocking the guy’s appearance and joking about his race. During the exchange, Hall made a series of jokes which prosecutors used during the penalty phase which, they said, showed Hall had “a lack of remorse for having committed capital murder.”

As a result, Hall’s lawyers say, the jury voted to put Hall to death.

In their legal docs, Hall’s lawyers say that before the Ross special was taped, they sent the Brazos County Sheriff a letter of “no contact” … asking the deputies to prohibit anyone from talking to Hall without their permission.

Clearly, that didn’t happen.

Stay tuned, folks, for the next installment.