An example of lawful and good not aligning but the law not being bad, in the most simple scenario I can imagine:
A heavy object is about to fall out of a window onto an unaware innocent across the road from you, (you can’t call out to them they can’t hear you for whatever reasons) you can’t just run across the road to push them out the way because the law says you may only cross the road at a designated pedestrian crossing further down the road, and even then when the lights say to, so you do so but you take too long as a result and the innocent is harmed by the falling thing, but you remained lawful and only crossed at the designated crossing, but ultimately less good came about of your actions because you choose law over good
The law was not wrong nor does it really need to be reviewed but in the moment law and good conflicted and one must come out on top
There are actually real-world laws related to this sort of thing; "Good Samaritan" laws, for example, specifically exculpate people for "ordinary negligence" (that is, for example, a failure to conduct CPR by proper current procedure, but still conducting CPR to try to save someone's life), even if that ordinary negligence might have been a contributing factor to someone's death. They do not exculpate "gross negligence," which usually requires the demonstration of explicitly willful, wanton dereliction of duty, possibly even malicious intent.
I would also, in general, argue that any law which says "you cannot EVER cross the street outside the crosswalk
even to save an innocent person's life" is a bad law and needs to be changed. That's a draconian limitation, enforced to the exclusion of rationality; no rational law-maker would ever knowingly and intentionally write a law that
explicitly said that. In fact, there are plenty of real-world situations, usually the result of a judge's ruling or the like, where formally criminal behavior conducted purely for the sake of an objective good (as in your example) is accepted as a sufficient mitigating circumstance to erase any need for legal action. (Some judges may even go further and lambast any law enforcement or prosecution for behaving in ways that could discourage people from doing good!)
I do not, personally, consider it even the slightest abandonment of Lawful behavior to say, "Traffic laws exist to protect the lives of anyone using the road or the sidewalk. To take actions which conform to the traffic laws
and thus result in preventable, innocent death is a violation of the purpose for which these laws were designed. No law worthy of the name requires behavior that contradicts the very purpose for which the law was made. Thus, although it may violate the
letter of the law, the
spirit of the law is in fact upheld by knowingly disobeying the letter in this case."
That is not a Chaotic person's response to this situation. A Chaotic person's response, as I am given to understand it (not being one myself), would be something like, "Who the f**k CARES what the law says! GO!" A Neutral person's response would likely be more or less the same, perhaps with a momentary twinge of guilt about jaywalking. The Lawful person, meanwhile, ensures that there is in fact justification for this act, even if it requires breaking the law. If it's a particularly
serious breach of the law, unlike this rather mild example, then they will likely do as was mentioned above and turn themselves in.
Let's consider a more effective example, one that's still a common canned thing but far less lopsided: the "would you steal to save your loved one from starvation/cancer/etc." dilemma. You are a relatively poor person, just barely making it day to day alongside your spouse and child. Your child develops a life-threatening illness which
will kill them if left untreated, but if it is treated, they are extremely likely to survive. (Nothing is guaranteed, but for the sake of argument, assume this is as close to guaranteed as it gets.) You cannot afford the medicine for the treatment, and something like a charity or government assistance could take weeks or months, time your child may not have. But as it so happens, you work as a janitor in a place that manufactures and temporarily stores this medicine. (Assume the medicine has a legitimate reason for being expensive--perhaps it is made using only non-fetal stem cells, which are very hard to come by, or is something like cisplatin where it is literally made using a precious metal.) It is against the law to steal, and in general most people agree that taking property to which you have no right is a problem, even if the specifics about who should own what property are not accepted. (Even Marx believed in
some kind of ownership, despite the claim "property is theft"; after all, since you're just a janitor, you had no part in making this medicine, so taking it would be alienating the people who actually made it from the product of their labors.) Do you steal the medicine to save your child?
A Chaotic person (of any G/N/E alignment) will almost certainly say yes without reservation and do it immediately, no regrets. NG, TN, and NE are likewise fairly likely to say yes, but might hesitate or dither a bit before getting on with it. Lawful Evil is likely to struggle mightily with this, unless there's some other method by which one could
obtain the medicine without personally
stealing it (e.g. exploiting the affections of one of the scientists who actually does have access, manipulating
them into stealing it and administering it to your child "without your knowledge"--LE is big on using patsies.) Lawful Neutral is probably the only alignment that would simply say "no, I would not steal it," though they would almost certainly be very upset about the situation.
The Lawful Good person, as I use and understand the term, would
eventually steal the medicine if there truly were no other option and time was running out--and would then turn herself in for having stolen the medicine, once she was reasonably sure the child was healed. That satisfies both requirements, recognizing the legitimacy of the law while still doing what is necessary to serve the good. You see similar sorts of things from conscientious objectors or certain forms of "civil disobedience." You recognize the authority of the state to exercise its laws, openly accepting the punishment for disobedience, but you still disobey because this
particular law or action (war, in the case of a conscientious objector) is unconscionable. That's Lawful Good in action. Lawful in general does not mandate slavish devotion, and it is one of the serious problems with alignment that
almost everyone legitimately does seem to think that "Lawful" means "slavish devotion to laws to the exclusion of rationality," but neither Neutrality nor Chaos mandates such slavish devotion. (Hell, even
Good doesn't require such slavish devotion--it's expected that even saintly folks take the occasional day for self-care!)
This is why Chaotic Evil is the best alignment. Not only can they "well that's just what they always felt like doing" on the Lawful-Chaotic spectrum, they can also "I'm pretending to be x alignment to throw off suspicion" to get around the Good-Evil axis, because while Good characters are always expected to hold up Good 24-7, evil characters (especially NPCs) are expected to put up fronts to fit in society. Therefore CE characters let you play your character however you want.
I'm sure you said this with tongue firmly in cheek, but for real, this is an actual problem I've had more than once. I have known WAY too many people who play "Chaotic Neutral" characters that are
really obviously some other point on the spectrum. Too many players are basically allergic to commitment, and the way CN (or, as you note, CE where it's permitted) is characterized by a lot of people, it truly can be parleyed as
compatible with literally any behavior. I basically had to slowly,
slowly convince a good friend of mine that his main characters were not "Chaotic Neutral" but were actually "Neutral Good" and "
Lawful Good" respectively, just in societies where "the law" is more handled by personally-upheld oaths than by external rules applied (in theory) equally on all members of the community. It was just really, really hard for him to believe that one of his characters actively sought order, stability, consistency, etc. because that meant
identifying with Lawfulness.