WHEN HIS WIFE LEFT HIM almost five years ago, Robert Grubbs Jr., now 29, began a desperate struggle to win custody of his infant son.

Grubbs hired a lawyer, Jerome F. Lieblich of McLean, but the custody dispute was lost in the Fairfax County Circuit Court. Then Grubbs paid a second lawyer, Robert R. Stone Jr. of Arlington, to appeal the case to the Virginia Supreme Court. Lieblich was to help prepare a summary of testimony in the case.

Stone did not file the appeal.In June, 1978, the Virginia Bar Disciplinary Board publicly reprimanded Stone for his failure to prepare and supervise the appeal and bring it to the state supreme court on time.

The way Grubbs sees it, he has lost his last chance to fight for his boy in court, although he could some day go back and ask the county judge to change his mind. Grubbs felt he was wronged by his lawyers and he tried to sue them for legal malpractice, a charged that both lawyers deny. But the law says Grubbs can't bring his -- not because he wasn't hurt, but in effect because he wasn't hurt enough.

Grubbs' problem is simple, according to the Virginia Supreme Court. To sue a lawyer for malpractice, the client must show that he suffered "actual damages," that he experienced some kind of injury.

Grubbs has indeed lost his son, but he cannot show that he ever had a real shot at winning custody. As the legal argument goes, Grubbs can never say what the Virginia Supreme Court would have done with his case if it had been appealed.

Therefore, the law says, Grubbs cannot sue for legal malpractice because he cannot show that he lost anything -- that he was damaged by his lawyers' conduct.

Regardless of whether Grubbs is right or wrong, there is a larger lesson in his case -- something illustrative of the legal system and how it doesn't always fulfill expectations. There are times when the law falls short of its promise of protection and compensation if they are due. When that happens, as it did to Grubbs, it seems unfair. He is a man with a complaint but nowhere to turn for relief.

The fact that Grubbs' appeal involved a custody question didn't make his attempt to file a malpractice case any simpler, said Grubbs' current attorney, David Ross Rosenfeld of Alexandria.

The Virginia Supreme Court rarely if ever reverses a trial court decision and awards custody to the father, Rosenfeld and other lawyers said. So, how could Grubbs support his claim in a malpractice suit that he would have won custody if the appeal had been filed?

The logic behind all this is laid out in a 1977 case handed down by the Virginia Supreme Court, which incidentally, in 1797, decided the first legal malpractice case ever recorded in the United States.

The theory underlying the 1977 case, known as Duesterdick, goes like this: If a client would have lost a case anyway, then what his lawyer did or didn't do doesn't matter in terms of a legal malpractice claim. No damage done. No grounds for recovery.

To sue a lawyer for malpractice, a client must prove three things: that the client employed the attorney, that the attorney neglected his duty and that the neglect resulted in a loss to the client. In his opinion for the state supreme court in Duesterdick, Justice George M. Cochran noted that that rule has been adopted by 45 states.

The state supreme court took that rule to the limit in Duesterdick, in which a corporation sued its lawyer for failure to defend a fraud claim that resulted in a $210,000 judgment against the corporation. The supreme court ruled that there could be no suit for malpractice until the money was paid -- otherwise there were no real damages. The court did not address the question of whether malpractice had occurred.

The case seems to say that if lawyers limit their bad conduct to bad cases, then the courts will say no harm done and leave the question of malpractice and the scolding -- if any -- to the bar disciplinary boards. Robert Grubbs didn't have much of a chance to win his case, so even though he paid for his day in the appeals court and didn't get it, it appears there is nothing he can do about it.

In a dissent in the Duesterdick case, Justice Richard H. Poff offered some thoughts on what he saw as the special nature of legal malpractice cases.

A lawyer has a relationship of trust with his client and the client is "utterly dependent upon his [the lawyer's] knowledge, his skill and his honor," Poff wrote. Any breach of that trust, Poff said, "demeans the integrity of the profession and impairs public confidence in our system of justice."

Lawyers are officers of the court, Poff said, and the court has a responsibility to the client, the profession and the public at large "to make and enforce rules which promote excellence in the practice of law...

Edward Bennett Williams, who is not known for chatting with reporters, held forth on everything from the Baltimore Orioles, John Connally, a Kennedy candidacy and his former law partner Joseph A. Califano Jr. while he waited last week for the verdict in the retrial of Dominic F. Antonelli Jr. and Joseph P, Yeldell in Philadelphia.

Williams said he still didn't know whether Califano, the former secretary of Health, Education and Welfare, would return to the firm, Williams & Connally, once he finished writing his book.Williams did indicate that he would not be happy if Califano came back to practice law and then soon departed for a post with the Kennedy campaign.

Policy makers for the federal judiciary, also known as the Judicial Conference of the United States, last week approved a plan for pilot programs designed to test and improve the quality of legal practice in the federal courts.

The pilot program, limited to a few district courts who voluntarily participate, will include an examination on federal practice subjects, a trial experience requirement for lawyers who want to appear in those courts and a peer review system. A special committee of the judicial conference will oversee the pilot program.

The plan was part of a final report of a committee headed by U.S. District Judge Edward J. Devitt of Minnesota and appointed by Chief Justice Warren E. Burger. The conference also agreed to recommend that the American Bar Association change its law school accreditation standards to include requirements for courses in trial advocacy and trial participation.

OBITER: Dan Webster, formerly of the office of general counsel at the Treasury Department, and Charles Richard Johnston Jr., formerly minority trade counsel for the Senate finance committee, have joined forces and gone into private law practice in Washington . . . Robert C. Goodwin Jr., former assistant general counsel for international trade and emergency preparedness at the Department of Energy, will join the Washington office of Thompson, Hine, Caldwell & Greene at the end of the month . . , The 6th Annual International Law Weekend, sponsored by the American Bar Association and area law schools, will be held on Oct. 5 and 6 at George Washington University and the Georgetown Law Center.