Poor writing of law is never a basis for overturning a conviction. Hard-core ambiguity might be, in which case the "rule of lenity" may choose between possible interpretations of a clause. See US v. Universal C.I.T. Credit Corp., 344 U.S. 218
when choice has to be made between two readings of what conduct
Congress has made a crime, it is appropriate, before we choose the
harsher alternative, to require that Congress should have spoken in
language that is clear and definite. We should not derive criminal
outlawry from some ambiguous implication.
re-cited in a chain of rulings up to Dowling v. United States, 473 U.S. 207 and beyond. However, there is the case of US v. Yermian, 468 U.S. 63, there the defendant made a false statement in a job application, and was convicted of violating 18 USC 1001 which said (wording at the time of the crime)
whoever, in any matter within the jurisdiction of any department or
agency of the United States knowingly and willfully falsifies,
conceals, or covers up by any trick, scheme, or device a material fact
or makes any fictitious, or fraudulent statements or representations,
or makes or uses any false writing or document knowing the same to
contain any false, fictitious, or fraudulent statement or entry
shall be punished.
Yermian knew that his statement (about convictions) was false, and contended that the prosecution had to prove both that he knew the falsity of the statement (the easy part) but also that the statement was made in a matter within the jurisdiction of the US. The job application was to a private company, who then submitted materials to the government to get a DoD security clearance, which he did not know.
The court decided that the "jurisdiction" clause was outside the scope of the adverb "knowingly. The court does not engage grammatical science to learn that the structure is ambiguous, they instead rebuff the lenity argument by appeal to other considerations. They conclude that
Any natural reading of §1001 establishes that the terms "knowingly and
willfully" modify only the making of "false, fictitious or fraudulent
statements," and not the predicate circumstance that those statements
be made in a matter within the jurisdiction of a federal agency
which is to say, they believe that the interpretation where "knowingly" refers to both "in the jurisdiction" is not natural. Technical ambiguity is not enough, one has to establish likely ambiguity, that is, it is likely that a speaker of English would arrive at both interpretations. There is a related interpretive doctrine known as the "last antecedent rule" which says that a modifier only holds of the last (nearest) possible thing being modified. The courts long ago devised this "first thing preceding" rule to resolve rampant ambiguity (even so, the rule is invoked mainly as low-level support for a conclusion that was reached by other means). In Yermian's case, "knowingly" might modify jurisdiction (which precedes) or "false" which follows. I don't disagree with their naturalness judgment – the important thing to notice here is that this narrows the scope of "ambiguity" from "possible ambiguity" to "probable ambiguity".
Another important part of the court's reasoning is based on legislative history, derived from reading earlier versions of the law (which, incidentally, has been re-worded since Yermian) – the "legislative intent" of the Congresses as a whole from 1918 up to the version applied against Yermian does seem to indicate a desire to prevent defrauding the government and there is no direct evidence that Congress intended to limit prosecution to just cases where a person also knew that the statement was "in a matter in the jurisdiction of the US". The court's conclusion is that all a person has to know is that they are making a false statement – it does not matter if they know that the statement is or has become "in a matter in federal jurisdiction".
The minority in this case (Rehnquist, Stevens, Brennan, O'Conner) find the language to be ambiguous, but that only shows that the particular conclusion about language is credible to reasonable legal minds. As the dissent puts it,
Although "there is no errorless test for identifying or recognizing
plain' or `unambiguous' language" in a statute, United States v.
Turkette, supra, at 452 U. S. 580, the Court's reasoning here amounts
to little more than simply pointing to the ambiguous phrases and
proclaiming them clear. In my view, it is quite impossible to tell
which phrases the terms "knowingly and willfully" modify, and the
magic wand of ipse dixit does nothing to resolve that ambiguity.
Liparota v. US, 471 U.S. 419 presents a similar situation about ambiguous scope, regarding food stamp fraud, where the statute (7 USC 2024(b)(1)) identifies the criminal act as:
Whoever knowingly uses, transfers, acquires, alters, or possesses
coupons or authorization cards in any manner not authorized by this
chapter or the regulations issued pursuant to this chapter
shall be punished. Again, there is ambiguity in the scope of "knowingly" – do you just have to know that you transferred the goods, or do you have to also know that the manner of transfer was not in compliance with the regulations? In this case, the court decided that the scope of "knowingly" must also extend to the authorization clause. In the holding, the court declares that "requiring mens rea in this case is in keeping with the established principle that ambiguity concerning the ambit of criminal statutes should be resolved in favor of lenity" (majority opinion written by Brennan, one of the dissenters in Yermian, which is cited in Liparota).
This is a topic on which books have been written. There is still no clear disposition of actually ambiguous laws.