Dealer Wants the Car Back

I bought a car in cash paid to a Toyota dealership. Ten days later, the dealership called me and said that I needed to return the vehicle to them because the vehicle could not be registered. When I asked why, they said the previous owner was not releasing the title. I am not sure if it is even legal for them to sell me a car with full payment received by them in cash, and now they are suddenly disclosing to me that they do not have the title and cannot register the vehicle and that I need to return the vehicle for a full refund. I spent a lot of time researching and bargaining with them on this vehicle, and I like it and would like to keep it. However, they don’t seem bothered and are not budging despite my efforts through the DMV Commissioner, the Toyota Brand support, and my reach out for a replacement vehicle of the same make/model/ specs. They keep saying that they can only offer a full refund. Is that all I can get from them now that the dealer registration expires in a day, and they are neither extending it nor giving me the title? Does someone have some experience with something like this in Virginia, and any suggestions?