This is the rogue line
def cfg = IDx4SessionPoolConfiguration.builder()
Changing this to something more normal like
def cfg = new ConfigurationBuilder()
fixes the problems. So does not compiling with @CompileStatic or running the code in a VM with -noverify option. The decompiled code looks jolly good in jd-gui.
The problem does not exists in 2.4.15-indy