Is it permissible for the lawyer to demand his fee for a case in which he did not adhere to the deal concerning it?
Question

Is it permissible for the lawyer to demand his fee for a case in which he did not adhere to the deal concerning it, in terms of the fee that was agreed upon and in terms of the deadline for completing the job, but he did not meet the deadline, and that happened more than once and to no avail?
Praise be to Allah.The agreement between you and the lawyer to which you refer comes under the heading of hiring someone to do a particular task, or appointing him as a representative in return for a fee to carry out a certain task requested by the one who hired him or by the one who was appointed as a proxy. In both cases, it is permissible and there is nothing wrong with it, but the one who is hired or appointed as a representative does not deserve the fee agreed upon unless he does the task that is requested of him.
It is the right of the one who hired him, or the one who appointed him as a representative, to demand that he do his job within the period agreed upon by both parties. That condition is binding upon both of them, meaning that the one who hires him does not have the right to demand that the representative should finish the task before that time, or to annul the contract between them before its time has expired
It was narrated that Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “The Muslims are bound by their conditions.” Narrated by Abu Dawud (3120); al-Albani classed it as sahih.
If the agreed-upon period expires without the representative having done the task requested of him, then the one who appointed him or hired him has the option of permanently annulling the contract between them, or of extending the period on the basis of mutual agreement, or of agreeing on a new contract, according to what they both see fit, without him deserving any payment for the work that he did before the new contract, or the period before the new deal.
It should be understood that the timescale is something that is to be taken very seriously with regard to completing work, especially in cases such as that mentioned, in which a great deal of harm may result from not meeting the deadline, especially if no other reasonable deadline is set after the first one has expired. This will mean that his appointment as a representative is of no benefit, and it means that the issue remains suspended until the one who is in prison completes his sentence, then he will come out after his sentence has ended, and that makes no sense.
It says in al-Mawsu‘ah al-Fiqhiyyah (45/91):
The representative is entitled to receive his fee when he submits the work that he was requested to do to the one who appointed him, if it is something that can be submitted or handed over, such as a garment that he weaves or sews. Once he hands it over to the one who appointed him, then he is entitled to the fee agreed upon.
If he appoints another man to sell an item for him, or to buy something for him, or to do hajj on his behalf, then he is entitled to the fee agreed upon once he has done that task, even if he has not yet received the price in the case of a sale. But if the one who appointed him stipulated that he should hand over the price before he will give him his fee, and the representative did not do that, then he is not entitled to the fee agreed upon, because he has not fulfilled the condition thereof. End quote.
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) said:
The fee becomes due as a result of several things, including the following:
1. Submitting or handing over the work he committed himself to do. So if you hired a worker to till this piece of land for you and he tilled it, then he deserves his payment now, in all situations, because he has done what was required of him, so he deserves his money. But he does not have the right to ask for the money to be paid to him before he finishes the work, because it is possible that he will not complete the work in accordance with the contract between me and him."(Ash-Sharh al-Mumti‘ 10/86).
Conclusion
This lawyer does not deserve any of the fee for what he has done of work, because he has not completed the task that he was appointed to do in the timeframe agreed upon. If you want to make a new agreement with him to do something else, that is up to you, otherwise he has no right to demand any payment for whatever work he has done in the past.
And Allah is the source of strength.