Just had a look at the different behaviour, ending a program with M2, M30 or enclosed by %.
At least the active G code is similar, after ending with M2 or M30, but reset to a state as described in the docs.
Enclosing the Code with %, F, Plane, M3, Offset and maybe more is keeping its programmed values.
I am not shure if it is still a problem, when using % in the main program and also in a called subroutine.
Ending M2
Ending M30
Enclosed with % %