The concern raised is a real one, but it is much less serious than one might naively expect.
Precedents Apply Only To Resolve The Legal Arguments Presented On The Facts Found To Exist At Trial
A Bad Lawyer's Failure To Develop Facts At Trial Isn't A Serious Problem
A precedent determines the law as applied to a particular set of facts found by the trial court and confirmed as properly in the trial court record by the appellate court, as to a particular legal issue.
Failure to prove facts at trial due to the fault of counsel for a party in the trial court changes the scope of the precedent. Failure to establish facts in one case that sets a precedent, doesn't prevent a similarly situated party, in a case with essentially the same actual facts, from doing a better job and thus presenting a set of facts that are not governed by the same precedent. The precedent from the ill argued case would not apply because the facts as found by the trial court would be different.
A Bad Lawyer's Failure To Present Legal Arguments Isn't A Serious Problem
if a someone lost a case merely because they did not come up with an
argument which, should they have come up with, would convince the
judge to rule in their favour, and that case has become a precedent,
the fate of any following cases in lower courts with comparable facts
will be decided by that unluckily slow-thinking litigant/lawyer.
Likewise, suppose that due to incompetence of counsel, a key legal argument isn't made. When a trial court lawyer makes that mistake, the precedent will merely resolve the legal arguments that were resolved by the trial court. This won't preclude a future litigant from making different legal arguments that are stronger in the same circumstances since the precedent won't resolve those legal arguments.
For example, suppose that a trial, a lawyer for one side fails to argue that the statute of frauds (which requires certain contracts to be in writing) bars the claim, and the judgment in favor of other other side on an oral agreement is upheld on appeal.
A lawyer in a new case with the same facts can move to dismiss the other side's claim based upon the statute of frauds, because the precedent upholding the oral agreement didn't resolve the question of whether the statute of frauds could be used to dismiss the claim arising under that agreement.
There Aren't Better Alternatives To Sift Through Legal Arguments
No lawyer can make every argument. The incentives of the system and the professional regulation of lawyers, however, increases the likelihood that the strongest arguments will be made to the court setting the precedent and in the trial court before an appellate court considers the issue, relative to pretty much any other means of clarifying ambiguous issues in the law, where the advocates for different legal rules usually don't have the same strong incentives to argue their cases as well as they possibly can.
The Risk Posed By Ineffectual Rhetoric In Favor Of Good Rules Of Law Is Real But Limited
This doesn't mean that bad lawyering doesn't give rise to bad precedents. But when this happens it is usually because for a given argument and set of facts, the lawyer for one side is so much more rhetorically effective in making a legal argument than the lawyer for the other side which is proposing a "better rule" of law. But the exclusion of people who can't finish law school and pass the bar exam from the process makes a truly decisive advantage for one party over another in rhetorical effectiveness fairly rare.
To the extent that rhetorical failure in appellate briefing is the cause of a bad precedent, the long term systemic effect of this problem (some would call it a feature of the system rather than a flaw) is that the side with more resources that can afford to hire better lawyers will tend to produce legal results that favor similarly situated parties going forward. Thus, it produces a sort of diluted "natural selection" effect (a bias that is equally, if not more concerning, in the duel of lobbyists for all sides of an issue in the legislative process).
The other safeguards discussed below, limit this risk, although not completely.
The requirement of an actual "case and controversy" for subject-matter jurisdiction, and the requirement of "standing" for subject-matter jurisdiction are designed to prevent someone from intentionally making straw man arguments on appeal that produce precedents that are bad law.
Thoughtful Appellate Judges When Opinions Are Published
Also, appellate court precedents are made by a panel of multiple (usually three at the first direct appeal level) experienced and esteemed judges who are acutely aware that the decisions that they are making in precedent setting cases influence the law in other cases which causes them to look beyond the arguments of the parties to resolve the dispute. It isn't at all uncommon in such cases for an appellate court to resolve a case on appeal on the basis of arguments not made by either party in their briefs, or precedents or statutes not mentioned by either party.
Furthermore, most appellate court decisions are unpublished opinions that expressly determined by the panel making the decision not to make a binding precedent, which allows panels of judges in these cases to take less care to run afoul of the risk of making a bad decision due to bad lawyering by a party. So, in the minority of cases that are published and create binding precedents, judges are especially careful to consider this risk.
Five More Safeguards
The other main safeguards in the case law system against bad precedents due to poor lawyering by a party are:
(1) the ability of uninvolved third-parties to file amicus briefs in connection with an appeal presenting perspectives on legal issues not presented by a party,
(2) the ability of a state supreme court or the U.S. Supreme Court (or both) as the case may be, to overrule intermediate appellate court precedents that were wrongly decided,
(3) the ability of legislatures to change non-constitutional legal rulings by statute,
(4) the procedural requirement that the relevant state or federal attorney general be given notice and an opportunity to intervene in cases challenging the constitutionality of a law, and
(5) the ability of the political process to amend the relevant constitution to address a bad binding precedent by a highest court on a constitutional issue that the legislature cannot fix.
Collectively These Safeguards Help Somewhat
None of these safeguards are fool proof.
But, collectively, these safeguards reduce the risk of a bad precedent being established due to bad lawyering in an adversary system, that the inherent limitation of a precedent being limited to particular facts and particular legal arguments provides as a primary means of preventing.
Other Causes Of Bad Precedents Are More Of A Problem
In general, once all of the considerations above are taken together, the risk of a bad precedent being made due to bad lawyering, while it is real, is significantly smaller than the risk that a bad precedent will be made because the appellate judges rendering the precedent making opinion are bad judges. Bad judges usually end up as judges with appellate precedent making power because they were selected more based upon political considerations, as they are in many states, and in the federal system, rather than primarily based upon the soundness of their legal judgment.
When one risk factor that can lead to a bad decision is much larger than another risk factor that can lead to a bad decision, further improvements in the smaller risk factor will rarely make all that much of a difference in the overall likelihood that the system will produce a bad precedent. So, the adversary system, is, on balance, good enough make the risk of bad precedents arising from bad lawyering a not very troubling problem with the system, even though it is a real risk that sometimes does produce bad precedents.