Fusion,
Glad it's working.
I didn't forget this thread just dealing with so many things and didn't have the time to get into a detailed look.
I did find that, when simulating, that there were additional moves shown in the graphic screen and didn't matter if G76 or G32 was used for threading.
Additionally , depending on how one selects a the start point of the threading the graphics would change, and BTW that was using you XML file.
To get a "cleaner" graphics display of the gcode produced you select a start, referenced / tool change location, with a 3x the lead away from physical
location of the material and I didn't get goofy display. Note that it's a screen issue and you should not actually have an actual axis move as shown on the screen. I know the above is not clear but, again, just don't have time to write it all up / explain in detail.
That's why I said to actually do a thread!
Anyway, it's working for you and life is good......
RICH