I am not very familiar with how gcode is generated so I am not able to answer that. But my process is: use Fusion 360 to setup cuts and then output it as a .nc file. I am cutting pieces of wood from a large stock material, so I manually jog to a spot where I have enough stock for the cut and then zero my x and y; I use a probe to zero my z direction. Once that is all set, I hit start to run the code. Everything cuts just fine, but the issue occurs after the tool is retracted, it jogs to a previous zero location. I tried uploading the gcode, but the system prevented me because I am a new user. I copied it below:

(film pocket and cont)

(T1 D=0.125 CR=0 - ZMIN=-0.0841 - flat end mill)

G90 G94

G17

G20

G28 G91 Z0

G90

(2D Pocket5)

T1

S11999 M3

G54

M8

G0 X0.0073 Y0.0006

Z0.6

Z0.2

G1 Z0.1125 F19.67

S12000

Y0 Z0.1088

Y-0.0025 Z0.1043

X0.007 Y-0.0065 Z0.1012

X0.0062 Y-0.0114 Z0.1

G2 X-0.1103 Y0.0114 Z0.0935 I-0.0583 J0.0114

X0.0062 Y-0.0114 Z0.087 I0.0583 J-0.0114

X-0.1103 Y0.0114 Z0.0805 I-0.0583 J0.0114

X0.0062 Y-0.0114 Z0.0739 I0.0583 J-0.0114

X-0.1103 Y0.0114 Z0.0674 I-0.0583 J0.0114

X0.0062 Y-0.0114 Z0.0609 I0.0583 J-0.0114

X-0.1103 Y0.0114 Z0.0544 I-0.0583 J0.0114

X0.0062 Y-0.0114 Z0.0479 I0.0583 J-0.0114

X-0.1103 Y0.0114 Z0.0414 I-0.0583 J0.0114

X0.0062 Y-0.0114 Z0.0349 I0.0583 J-0.0114

X-0.1103 Y0.0114 Z0.0283 I-0.0583 J0.0114

X0.0062 Y-0.0114 Z0.0218 I0.0583 J-0.0114

X-0.1103 Y0.0114 Z0.0153 I-0.0583 J0.0114

X0.0062 Y-0.0114 Z0.0088 I0.0583 J-0.0114

X-0.1103 Y0.0114 Z0.0023 I-0.0583 J0.0114

X0.0062 Y-0.0114 Z-0.0042 I0.0583 J-0.0114

X-0.1103 Y0.0114 Z-0.0107 I-0.0583 J0.0114

X0.0062 Y-0.0114 Z-0.0172 I0.0583 J-0.0114

X-0.1103 Y0.0114 Z-0.0238 I-0.0583 J0.0114

X0.0073 Y0 Z-0.0299 I0.0583 J-0.0114

S11999

X-0.0073 Y0 I-0.0073 J0 F19.66

X0.0386 Y0 I0.023 J0

X-0.0386 Y0 I-0.0386 J0

X0.0698 Y0 I0.0542 J0

X-0.0698 Y0 I-0.0698 J0

X0.1011 Y0 I0.0855 J0

X-0.1011 Y0 I-0.1011 J0

X0.1323 Y0 I0.1167 J0

X-0.1323 Y0 I-0.1323 J0

X0.1636 Y0 I0.148 J0

X-0.1636 Y0 I-0.1636 J0

X0.1948 Y0 I0.1792 J0

X-0.1948 Y0 I-0.1948 J0

X0.2261 Y0 I0.2105 J0

X-0.2261 Y0 I-0.2261 J0

X0.2573 Y0 I0.2417 J0

X-0.2573 Y0 I-0.2573 J0

X0.2886 Y0 I0.273 J0

X-0.2886 Y0 I-0.2886 J0

X0.3198 Y0 I0.3042 J0

X-0.3198 Y0 I-0.3198 J0

X0.3511 Y0 I0.3355 J0

X-0.3511 Y0 I-0.3511 J0

X0.3823 Y0 I0.3667 J0

X-0.3823 Y0 I-0.3823 J0

X0.4136 Y0 I0.398 J0

X-0.4136 Y0 I-0.4136 J0

X0.4448 Y0 I0.4292 J0

X-0.4448 Y0 I-0.4448 J0

X0.4448 Y0 I0.4448 J0

G1 X0.4446 Y-0.0024 Z-0.0294 F19.67

X0.4439 Y-0.0047 Z-0.0289

X0.443 Y-0.0065 Z-0.0276

X0.4418 Y-0.0081 Z-0.0262

X0.4399 Y-0.01 Z-0.0222

X0.4391 Y-0.0105 Z-0.0174

G0 Z0.6

(2D Contour1 3)

X-0.0125 Y-3.35

Z0.6

Z0.2

G1 Z-0.0716 F6.55

G19 G3 Y-3.3375 Z-0.0841 J0.0125 K0 F19.67

G1 Y-3.325

G17 G2 X0 Y-3.3125 I0.0125 J0

G3 X0 Y3.3125 I0 J3.3125 F19.66

X0 Y-3.3125 I0 J-3.3125

G2 X0.0125 Y-3.325 I0 J-0.0125 F19.67

G1 Y-3.3375

G19 G2 Y-3.35 Z-0.0716 J0 K0.0125

G0 Z0.6

G17

M9

G28 G91 Z0

G90

G28 G91 X0 Y0

G90

M5

M30