Also at N10 the S should not be there. and at N60. and G50 X0Z0 has no effect or a bad effect because 10T has geometry offsets and workshift so G50 X...Z... is not used. In this case G50 is only used to set the maximum RPM.
also G80 has no effect or is not valid because G80 is a canned drill cycle cancel on a mill.
you could cut the program to this and it'll be functionally identical.....
N20 G28 U0 W0;
N30 G50 S1000;
N40 G40 G20 G99;