Thank you for your response.
If your contract had a mortgage contingency clause and you were denied the mortgage, this is one ground to cancel the contract without penalty and get your money back.
If you waived inspection, but there was a clause in the contract that made it contingent on your walk through and it did not legitimately pass the walk through based on the broken AC units, then this too would be grounds to terminate the agreement based on the discovery of defects on your walk through inspection.
The botXXXXX XXXXXne is you need to prove that one of the clauses in your purchase agreement was not legitimately satisfied in order to recover your deposit back and terminate the contract without penalty. If there are no legitimate grounds under the contract of purchase, then you can cancel the sale, but you would end up losing any money designated as "earnest money" for doing so absent a breach of one of the contingency or other clauses in the contract.
Thank you so much for using JustAnswer.com. I truly aim to please you as a customer, but please keep in mind that I do not know what you already know or don't know, or with what you need help, unless you tell me. If I did not answer the question you thought you were asking, please respond with the specific question you wanted answered. PLEASE use REPLY to EXPERT if you would like more information or if you feel something was not included in your answer.
Kindly remember the ONLY WAY experts receive any credit at all for spending time with customers is if you click on OK, GOOD or EXCELLENT SERVICE even though you have made a deposit or are a subscription customer. YOU MUST COMPLETE THE RATING FOR THE EXPERT TO RECEIVE ANY CREDIT, if not the site keeps your money on deposit.
Also remember, sometimes the law does not support what we want it to support, but that is not the fault of the person answering the question, so please be courteous.