If buyer was still within the contingency period, then they can pull out of the sale without penalty, since they may do so within that period. But if they are outside that period--as they most likely were, if this was the day before closing--they can no longer use the contingency. If they refuse or fail to close, the seller can at a minimum keep the deposit or earnest money; and if the seller can prove that they incurred costs or losses that exceed the amount of the deposit, the seller could sue for the balance of those costs or losses, so long as there contract of sale did not have some provision or term limiting the seller's recovery to the deposit.