The error seems to be in the generated PIR code. From
src/gen_actions.pir (lines 6306-6315):
control_3001:
.local pmc exception
.get_results (exception, $S10)
getattribute $P3250, exception, "type" # Null PMC access in type()
ne $P3250, 89, control_3001_rethrow
getattribute $P3250, exception, "payload"
.return ($P3250)
control_3001_rethrow:
throw exception
.end
Everything else seems to work, the line with the $/.panic
(src/parser/actions.pm:1984) is reached...
I don't have sufficient knowledge in PIR or NQP to probe this further.
But maybe this helps someone who has.