You may be right.
So you may need to ask your agent or attorney write a response to the seller's agent stating that earnest money should send back to you.
The problem is not you explain the contract.
Finally, it may be a court decision.
Read the whole contract may help to understand.