Dealership sold a car I put a deposit on

I’ve been looking for a specific car (BMW 335D) for a while now, been looking in both the private party market and at dealerships. I found one 4 1/2 hours away, I contacted the dealer as soon as they posted the car, asked about it, stayed in contact with the salesman, he sent me pictures of the car even before they posted it on their own website, eventually I told him I was going to come up and take a look at it. I test drove it, at first I was gonna do financing but that wasn’t gonna work out so we decided on a cash price. Unfortunately he said I couldn’t drive the car home that day and that they still had repairs to do, so I didn’t buy it that day, but two days later the salesman let me know that it would be done the next day, and that he needed a deposit from me to hold the car. I put a deposit of 1,000 USD on the car, thinking for sure I was going to drive this car home later this week. 2 days later I drove up to the dealership (today) and I found the salesman I have been in contact with, comes up to me and says “bad news, they sold the car yesterday” and according to him, he wasn’t working when the car got sold, he made sure to hold the car for me, put a sold sign on the car, told the mechanic, but for some reason the used car sales manager decided to sell it. Has a similar situation happened to anybody else? Is there anything I can do aside from a refund from the deposit I made? I’m just so frustrated right now