Extra moves after then end of gcode file

I am using the snapmaker for some lab automation. I have the 3D printer head connected because it wouldn’t shoot lasers if accidentally activated and it sets the steppers up for faster rapid moves. When I execute a simple gcode file like the below FROM THE SD CARD, it makes all the moves and makes extra moves after the file ends. It seems to try to re-home every axis. It is probably fine for 3d printing finishing up, but it is NOT okay in my application. I’ve put M0, M1, M112, you name it at the end of the file. It seems snapmaker ignores the M0 and homes afterwards anyway. PLEASE HELP!

( Lift wand )
G0 Z0
G0 Y125
G0 X125
G0 Y60
M0

Hey, may you upload your gcode and describe what you are doing special?
(photos of your machine are welcome :wink: )

I am not sure if M0 is supported
This comes from marlin website for M0: “Without an LCD controller or EMERGENCY_PARSER this command is ignored.”
I think the touchscreen is not clarified as lcd-controller so it has none…

Share the gcode with us.
After 3D printing finishing, the printing head always goes to the home axes. Let me check the gcode first.