This is not a case of a buyer backing out. A buyer backs out BEFORE closing, not after. You should have gotten a check at the closing for your proceeds from the sale.
Let me guess. You didn't use an attorney, you used an 'escrow agent', right? Don't like them, don't trust them. Title companies do not pay anything unless they have made a serious error in doing the title work, there is a problem with the title, and they have to make good on it. This was an escrow company deciding to give the buyer back YOUR money instead of giving it to you.
It's unusual for you to get what you would have gotten if you had sold the house AND get the house so you can sell it again, but maybe you weren't making very much on the sale and they decided it was better to do that than be sued.
Now, the question is - did you ever pay the broker that procured the sale? That broker is due their commission. They did what you hired them to do, it is not their fault this thing fell apart. If the earnest money was equal to their commission, then they have the right to keep it. If the earnest money was less than the commission you agreed to pay them, then you owe them the difference. You could go to the 'title company' for that, but it sounds like they made you a settlement offer and you took it, and they are done with you.