That depends. Have you removed your contingencies? If not, this is one way to retrieve your deposit. Also, who's fault is it that the transaction hasn't closed...? Was a Notice to Perform issued? Or a Demand to Close? Take it up with your agents manager. Good luck.
If an escrow period is going to extend beyond its mutually agreed closing date, then it must also be mutually agreed to postpone the closing date. Additionally, if you already have satisfied all the contingencies within the time frame allowed in your offer, then you must close escrow or stand to lose your earnest money deposit. Consult your attorney on these matters.
Do you have an agent/broker representing you? I would recommend to contact them first as they know first hand what is written in your contract. If all contingencies were removed, this might be true, but you still should possibly seek the advice of your own attorney's guidance and as I said before, your agent is the one that knows your contract best, speak to them and if that doesn't help, speak to their broker.
Who's lawyer said you can't get your money back?
If it is the other side's lawyer, get your own ASAP.
Who's fault is it for the reason of bit closing on time?
Are you represented by an agent, and if so, what are they saying about the situation?
That depends on the seller. Each sale is case by case. If the sellers feel you have not performed and their property was kept off the market. Yes they can ask for damages ie your earnest money deposit.
You all will have to come to a mutual agreement...You stated the lawyer said you cannot get your money back, what type of sale was it? Probate,standard,short sale?