Changing the G28 command - home position

Hi folks,

I need your help on changing the home position - if that is possible at all.
Why? I fucked up my new fancy enclosure made of wood and fabric sliding walls… It’s 40mm too short and when the printer gets home, the print bed comes forward and hits the front of the enclosure…
I know right how can you fuck this up… well I did and still unsure why. Redoing the enclosure is just too much work I’m afraid.

All I need is the printer to stop the G28 command at the end of the print (as the forward door is closed and I am not present). I looked at changing the end g-code and it sort of works, but internally the machine still homes the Y axis. Here is my end g-code:

; end g-code

M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off (if you have it)
G90 ;absolute positioning
G92 E0
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G28 X0
G1 Y300 F3000
M84 ;steppers off

at the end of the print, the machines homes the x axis, get the Y axis to Y300 and then I don’t understand why the rest happens:

Z gets to zero but I don’t see this in the g-code, and then it brings the Y axis home as well.
Bing it hits the front door…
I can only see an internal function homing no matter what the end g-code is…

How can I change that, if this is possible?
Thanks for your help!

Remember the machine must home at startup so it knows where it is. There’s no way around homing the Y axis.

Separately, G28 X0 is not a supported command. You can see the supported usages here: Auto Home | Marlin Firmware. I think the parser will remove the X0 when it’s coerced to a boolean and you’ll just be left with G28, which homes all axes.