Welcome to the world of law. Often I've seen it said that thinking like a software developer, looking for edge cases and such, will get you smacked down by a judge who doesn't let you just use loopholes. There is an XKCD about insurance law on this topic. But the reality is that a lot of loopholes do work, and have a better chance of working if you have a really good lawyer. Part of the equation is how charismatic a lawyer is and if they can pull up records of the loop hole happening in the past (assuming you are in a court that allows past rulings to have impact).
From what I've seen it is extremely arbitrary and is extremely frustrating. I was on a jury once, where one witness was told to tell only what they had heard/seen/etc. They would try to say "I heard so and so say such and such", and the other side would object. The judge would then say to tell only what you saw, heard, etc., not what other people did or said. And I'm sitting there thinking "But what that is exactly what they were trying to do!" (of course I couldn't say a single word for risk to my own safety).
From what I've seen it is extremely arbitrary and is extremely frustrating. I was on a jury once, where one witness was told to tell only what they had heard/seen/etc. They would try to say "I heard so and so say such and such", and the other side would object. The judge would then say to tell only what you saw, heard, etc., not what other people did or said. And I'm sitting there thinking "But what that is exactly what they were trying to do!" (of course I couldn't say a single word for risk to my own safety).