Sorry to hear that. I'm not sure exactly what went wrong, but there is no way that you should have been asked to move all your stuff out before actually having a clear to close from the buyer's bank. Something definitely went wrong. If your attorney said you cannot keep their down payment, that most likely means the buyers never obtained a commitment from their lender. Four extensions means you were jammed up for MONTHS, without a commitment? Who was looking into this for you? Someone didn't do their job.
Your agent should have been all over it, considering that there were 4 extensions. One extension is usually a red flag. One extension usually means that there is a problem somewhere. Your agent and/or attorney should have found the problem way before it got to a 2nd extension. Obviously the reason for why there was a 1st extension somehow lead to a 2nd, 3rd, 4th and finally a dead deal. Would of been more efficient to find out what the problem was from the very 1st extension.
I suggest you fire them and find a Realtor who is capable of putting a solid deal together so that this doesn't happen again. An agent should do all possible to make sure the buyers are indeed qualified before you're put into a contract that'll tie you up for months. Your agent should also be capable of following up with the loan officer, attorneys and all parties involved, to make sure that deal is moving along smoothly. It's what I would do!