You are just experienceing what some of us already know when you move away from just very basic Gcode.
Yeah, I know ... :-)
But ,you know, if I am careful as to what instructions I use in the nested SRs then parametric coding with deep nesting works quite well. g0, g1, g2, g3, drilling - they all work OK. Some rotation and translation also work fine. I've got a lot of working code.
OK just tried it and it errors out every time with "return called with no sub in effect....looping" as it should have.
I have had that error msg when I put an m99 into the top-level code in place of an m98 (oops!), but I don't get that with the duplicate subroutines. Anyhow, that would be the wrong error msg for this problem as the m99 at the end of the second SR is structurally correct.
Odd.
Cheers