The best thing would be to read your contract carefully, and, if not sure, to see an attorney.
If you cancel within time allowed to inspect, you should be fine canceling the purchase, and your escrow money ($3,000) will be safe. If you don't get the mortgage for certain reasons, and tell the seller about it before your commitment date (in writing), you don't have to buy and you get your escrow money back. If your property does not appraise into the purchase price value, same thing...
However, even if you change your mind, with the help of an attorney, there could be other ways to either getting all of your escrow or a portion of it back.
Hopefully, you are still in the inspection time period...good luck to you!
Beachfront Realty, Inc.