Nice find. I’ve got no clue what’s going on, but I can tell you the same thing happens in the current development version. I expect your conclusion is correct that it would take a fix in the compiler to solve this.
bug reported as I7-2491
(It’s not an attractive approach, but you could modify the I6 generated by inform7 to change RunRoutines(actor, grammar)
to RunRoutines(actor, A_grammar)
, then compile the I6 manually.)