it’s some lines missing in your g-CODE. mine are below from Cura. this is in the slicer and in the machine settings. there is a start and end g-code this is my end g-code
G1 X0 Y{machine_depth} ;TaDaaaa
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend
M140 S0 ;Turn-off bed
M84 X Y E ;Disable all steppers but Z