Again, I disagree. That exact situation is the law revealing that it is flawed and needs to be changed. That's the whole point of reviewing your laws to make sure they're still effective. You know your laws will be imperfect, so you must continuously vet them.
A law that directs you away from Good is a bad law (here and elsewhere assume an appended "from the perspective of an LG person.") It may be only bad in a very small way, or in an unlikely circumstance, or in a focus that could not have been foreseen, or due to an unexpected intersection with some other law. But as soon as the law directs you away from Good, it is a bad law, and needs to be changed. This is quite literally how Common Law works: the courts exist both to confirm the actual state of affairs so that correct judgment can be rendered, and as the final review on laws so that missteps or errors can be corrected. (This is, incidentally, part of why I find the "civil law" system both baffling and deeply concerning; the whole doctrine of "parliamentary sovereignty" is very worrisome specifically because it makes the review of laws so much more difficult.) Judicial review is absolutely one of the most Lawful procedures around, full of the gravitas and patience I previously described, and yet its specific purpose is to determine whether or not laws actually conform with orders and principles higher than the law itself (for the US, the Bill of Rights, which enshrines numerous freedoms as supreme to any law, be it local, state, or federal.)
Edit: Further, this provides an excellent opportunity to show why I get so frustrated with alignment.
What is the Chaotic equivalent of "the law is imperfect and might direct you away from Good"? I have never actually found anyone who could articulate a clear example of "things Chaotic people can't do and still be Chaotic," whereas you can absolutely give examples for all three other alignment poles (Lawful, Good, and Evil). It's why I so consistently refer to Chaotic as a garbage non-alignment as written, since it cashes out as "anything goes," a completely useless metric indistinguishable from Neutrality, or even indistinguishable from Lawful under the right circumstances.