In NQP, all variables get declared at the beginning of the block. This makes the following code fail:
my $old := $*VAR; my $*VAR := $new;
Instead of the old (outer) value of the contextual $*VAR, $old contains Undef. The following one line fix to nqp-rx seems to solve this problem by making NQP declare variables at the same point in the generated PIR as they are in the NQP code.