For future reference keep in mind lenders can check credit up to the day of closing. Most contracts do have a contingency for recovering your earnest money. If you used the Texas Real Estate Commission (TREC) contract you have paragraph 4 section (2) that stipulates, contract is subject to Buyer being approved for financing and the third party financing condition addendum spells out how many days you will be given to get approval, provision allows you to pullout of the contract without losing your earnest money if you cant get financing. "Time is of the essence for this paragraph." If you fall within this time limit you should be able to recover your earnest money.
Unfortunately your investment with the appraisal and inspection cost are lost.
My advise is check your credit report for errors. Your agent should help you. - Tue Nov 10 2009, 18:19