Hi Tracy. Unfortunately, this happens regularly – especially at weekends when the sales staff are all at work but the admin staff who process the paperwork are usually not. You have hundreds of salespeople all trying to sell customers the same cars, and inevitably two buyers will be signing up to buy the same car at the same time in two different locations. This only gets discovered after the event, so one customer gets the phone call with the bad news.
If the car you bought was at a different dealership or branch, then it would be up to that other branch to honour the contract you signed at your branch. If they had sold the car to a customer they had in their own showroom, they will inevitably keep the car for their customer.
Ultimately, your best bet is to take your deposit back and look elsewhere rather than get the dealer to try and source you another car. They will always try to find you the car that they want to sell you, which is usually not the same car as the one you want to buy.