GROOVY-5980: Finally executes twice on NPE while casting method result