EXCLUSIVE

XXXTentacion thought he was catching a huge break in his domestic violence case, but it looks like prosecutors are shutting that door on him ... TMZ has learned.

The rapper and his attorneys submitted a document on Friday they say was signed by his ex -- the woman he allegedly beat while she was pregnant. According to the doc, obtained by TMZ, she's now refusing to cooperate with prosecutors and wants the case to go away.

It wouldn't guarantee XXX is off the hook, but it would make it more difficult to convict him.

However, Miami-Dade prosecutors are calling BS, telling the judge they doubt the ex-girlfriend really signed the doc. They also say, even IF she did, it doesn't stop them from going forward with prosecution.