6:21 AM PT -- We're told Bam's team has returned the check without cashing it.
Bam Margera going to rehab has a celeb boxing promoter in a tough spot -- he's looking to get back the dough he just fronted Bam to ref a high profile match.
Damon Feldman, the promoter putting on a bout featuring the infamous Bagel Boss, tells TMZ ... Bam got half of his fee up front -- a cool $2,500 -- after signing a deal last week agreeing to be a ref. The deal called for Bam to get another $2,500 after the event. Damon says he hopes Bam gets better soon, and he won't hold the "Jackass" star to his contract.
The only catch ... Feldman says he wants his money back.
As we reported ... the "Viva La Bam" star is spending the next 60-90 days in treatment, meaning he's unavailable for the September 7 event in Atlantic City. Damon says he's contacted Bam's team to get the money back, but so far, radio silence.
TMZ broke the story ... Damon and Bam agreed to the deal just before Margera went off the rails last weekend -- berating a Southwest Airlines employee and getting booted from the flight.
The next morning, Bam took to social media and pled for Dr. Phil's help because his "family is in shambles" ... claiming his troubles were worse than ever.