almost certainly you signed something bad. referral agreements with clawback clauses tied to net seller proceeds are enforceable in arizona if you agreed to them in writing, and most people don't read that paragraph because it's buried after the fee schedule.
the number that killed you is the spread between 281 and 340, a 17% miss on arv, which in phoenix Q1 last year was a known problem in the 260-320 band because comps from late 2022 were still being used to underwrite deals that closed into a softer spring market.
next time get your referral fee structured as a flat amount due at close regardless of net proceeds, or don't stage until you've seen a signed settlement statement showing the arv assumption was stress-tested at minus 10%.