Technically speaking this is lawful under the interpretation of the law. That doesn't make it desirable, ethical or morally acceptable on any level.
At the same time, in any very complex set of overlapping rules, it only requires finding a suitable expert to extract the conclusion you decided on up front.