G65 H01 P#121 Q4000 should load the value of Q into variable #121
However, if your example program snippet is exactly as it appears in the control, I note that you have a "," instead of a period (decimal point); you've done this in both your main and sub program examples(see below). If this is the case then this may be upsetting the control. I'm not sure whether the control will even accept a "," as in all my years of being involved with NC and CNC machines, I've never made that mistake nor tried to use "," in a program, even in a comment. If you have used a ",", I would have expected a different error.
G17 G40 G54 G21 G90 ;
G00 X0 Y0 Z0,5 S400 M13;
G81 X#108 Y#106 R0,1 Z-13,1 F50
If this is not the case, and you are using periods, the way to find a problem with Macro code that is defying logic, is to put the one line of code you suspect to be the problem in a program by itself. Construct a program as follows to see if you get the same error when you run it.
The only thing the following program does is load the value of 4000 into #121
G65 H01 P#121 Q4000
Run this program and when it stops at the compulsory stop M00, look up variable 121 in the Macro variable register to make sure that the value 4000 has been stored. If this works, continue to add code one block at a time, and always include the M00 before the end of the program so that you can check that the correct values are appearing in corresponding variable in the Macro variable register.