Congratulations, you posted this question in the correct category. This category often confuses many visitors to the Lawguru site.
I write separately to address the various issues, and to partially disagree with the previous responses to some extent.
First of all, the State Bar Act (which is contained in California's Business & Professions Code) identifies two types of retainer agreements that must be in writing. Contingency fee agreements must be in writing, and retainer agreements in which it is foreseeable that the total extepnses to the client for both fes and costs will exceed $1,000.00. (Bus. & Professions Code, section 6148 subd. (a).)
I can see how the two prior attorneys assume that this is triggered by your hypothetical, and in many unlimited civil cases, I can see that costs and expenses would exceed $1,000. But the facts in your hypothetical are not dispositive of that issue. If the attorney was hired for a small claims appeal, in which you bore the costs, or made a limited scope appearance, or was hired only to file a pretrial motion, I can see situations where the costs and expenses would not exceed $1,000, and a written retainer agreement would not be necessary.
Failure of an attorney to have a written fee agreement when required voids any oral fee agreement or billing at the election of the client. This does not mean the attorney does not get paid, however, aas the attorney is entitled to collect a reasonable fee under the doctrine of quantum meruit for his or her services that were rendered. The failure of the attorney to get a written retainer agreement does not also mean he or she is your attorney forever, either.
A client has the option of firing the attorney at any time, with or without cause. The attorney on the other hand, must either obtain the client's consent and execute a substitution of attorney, or file a motion to withdraw, if the client does not consent. The motion to withdraw requires court approval.
A failure of a client to pay an attorney's fees and bills is normally a ground for a motion to withdraw. The procedural requirements are set forth in California Rules of Cout, rule 3.1362. California case law has generally held that trial courts are not supposed to allow attorneys to withdraw on the eve of trial, or where a dispositive motion (such as a summary judgment motion) is pending and a new attorney has not been retained. This has historically problematice when the client was a minor or a corporation, and could not represent themselves.
I would need a lot more factual detail and have to perform some research on whether or not the trial court's allowance of an attorney to withdraw at the trial state constituted a mistrial. My gut instict is yes, but you would be stuck with either filing a motion for a new trial with the judge who erroneously let the attorney out at the trial stage, or filing a time consuming and costly appeal.