In the meantime, you may want to work out an agreement to compensate the seller for your time living in the home until your financing can be approved.
Unfortunately, it's often very far into the buying process before the lender clearly understands there are financial factors that do not allow the applicant to qualify for funding.
An attorney would be able to advise you best on your course of legal action.
If I were your agent, I'd be scrambling to get you another loan. There's still a good chance you can be approved with a different lender.
The good news is the seller wants to be done, you want to be done, now it's just a matter of getting it done! All parties are on board for finalizing this.
A good lender will look over everything and see where you stand. You may need a 30-60 day extension and perhaps rent that home for a month or two from the seller until you can get your loan situation covered. All this needs to be done in writing. I'm wondering if there was something that needs cleared up on either of your credit reports? That could take 30 days or so to clear.
The seller's agent should have never given the green light for early occupancy since they should know nothing is final until title transfers.
RE/MAX Real Estate Group
Did you sign an Addendum for Occupancy Prior to Title Transfer?
The first page of your purchase agreement should have a Finance Contingency - as long as you applied for your loan in the amount of time provided you should be able to get your Earnest Money back.
I would be happy to speak with you to discuss.
Finally, you are living in a house that isn't your property. The seller's agent should have never let you move in before closing, knowing that these things can happen. I highly recommend moving out as quickly as possible.
A bank can, for just about any reason, deny someone a loan all the way to closing. I don't think you have any legal recourse against them, but it can never hurt to talk to an attorney.