if you are not able to occupy a mortage, the seller has the right to cancel the deal. In purchase agreement you must declare a contigency that you have the right to get back the deposit if the loan cannot be approved. Your agent should protect your right otherwise, you can report to DRE (CA residency)