Y-axis print coordinates out of range mid print after filament change

I am losing my mind! I have a pretty decent understanding of 3D printers, but for some reason I cant figure this one out. I can do a single color/material print, and it works perfectly fine; however, when I try doing a multi-material/color print, the printer will print the first color fine, but as soon as it switches colors, the bed shoots forward and gives me the y-axis error. I’ve tried 3mf files and stl files, but it does the same thing no matter what. I really don’t understand why this is happening, but it’s very frustrating. I dont change settings, and I always make sure my printer is correct before sending. The printer is clean and free of debris on the y-axis rails, as well as no obstructions preventing the bed from stopping. HELP!

How did you slice the file? With the current Creality Print version on PC? It’s more about the GCODE not STL/3MF probably. You could look at the GCODE file to see if there is a strange Y axis movement close to the filament change or if it’s coming from the printer itself.

I’m on Creality print 7.1 for PC. I was looking through my GCODE, but didn’t really see anything out of the ordinary either. Maybe there’s something I’m missing. This issue is relatively new, as I’ve already done multi-color prints with no issue.

Here’s my gcode for filament change:

{if toolchange_count > 1 }
G17
G2 Z{z_after_toolchange + 0.4} I0.86 J0.86 P1 F10000
{endif}
G1 X0 F18000
M106 S120
M8200 P S[next_extruder]
M220 S100
{if long_retractions_when_cut[previous_extruder]}
{if retraction_distances_when_cut[previous_extruder] < 28}
M8200 R E-{retraction_distances_when_cut[previous_extruder]}
{else}
M8200 R E-28
{endif}
{endif}

M400
G1 X5 F10000
SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=500
G0 F500

M8200 C S0
SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=5000
G0 Y255 F18000
G0 X267 F18000
G0 Y130 F18000
G0 X278 F2400
M8200 R
M106 S30
M104 S[nozzle_temperature_range_high[previous_extruder]]
M8200 L I[next_extruder]
{if long_retractions_when_cut[previous_extruder]}
{if retraction_distances_when_cut[previous_extruder] < 28}
G1 E{retraction_distances_when_cut[previous_extruder]} F{old_filament_e_feedrate}
{else}
G1 E28 F{old_filament_e_feedrate}
{endif}
{endif}
T[next_extruder]

{if flush_length_1 > 1}
;flush_length_1=[flush_length_1]
; FLUSH_START
M106 S70
{if flush_length_2 > 1}
M104 S[nozzle_temperature_range_high[next_extruder]]
{else}
M104 S[new_filament_temp]
{endif}
{if flush_length_1 > 32}
G1 F60
M400
G1 E32 F{old_filament_e_feedrate}
G1 E{(flush_length_1 - 32) * 0.02} F60
G1 E{(flush_length_1 - 32) * 0.23} F{old_filament_e_feedrate}
G1 E{(flush_length_1 - 32) * 0.02} F60
G1 E{(flush_length_1 - 32) * 0.23} F{new_filament_e_feedrate}
G1 E{(flush_length_1 - 32) * 0.02} F60
G1 E{(flush_length_1 - 32) * 0.23} F{new_filament_e_feedrate}
G1 E{(flush_length_1 - 32) * 0.02} F60
G1 E{(flush_length_1 - 32) * 0.23} F{new_filament_e_feedrate}
{else}
G1 E{flush_length_1} F{old_filament_e_feedrate}
{endif}
{else}
M104 S[new_filament_temp]
{endif}

M400
M106 S255
G4 P2500
M106 S30
G1 E-[old_retract_length_toolchange] F1800
; FLUSH_END

; WIPE
SET_VELOCITY_LIMIT ACCEL=10000 ACCEL_TO_DECEL=10000
G0 X267 F24000
G0 X278 F2400
G0 X267 F24000
G0 X278 F2400

{if flush_length_2 > 1}
;flush_length_2=[flush_length_2]
; FLUSH_START
{if flush_length_3 < 1}
M104 S[new_filament_temp]
{endif}
SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=5000
M106 S70
G1 F60
M400
G1 E{flush_length_2 * 0.18 + old_retract_length_toolchange} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F60
G1 E{flush_length_2 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F60
G1 E{flush_length_2 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F60
G1 E{flush_length_2 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F60
G1 E{flush_length_2 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F60

M400
M106 S255
G4 P2500
M106 S30
G1 E-[new_retract_length_toolchange] F1800
; FLUSH_END

; WIPE
SET_VELOCITY_LIMIT ACCEL=10000 ACCEL_TO_DECEL=10000
G0 X267 F24000
G0 X278 F2400
G0 X267 F24000
G0 X278 F2400
{endif}

{if flush_length_3 > 1}
;flush_length_3=[flush_length_3]
; FLUSH_START
{if flush_length_4 < 1}
M104 S[new_filament_temp]
{endif}
SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=5000
M106 S70
G1 F60
M400
G1 E{flush_length_3 * 0.18 + new_retract_length_toolchange} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F60
G1 E{flush_length_3 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F60
G1 E{flush_length_3 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F60
G1 E{flush_length_3 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F60
G1 E{flush_length_3 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F60

M400
M106 S255
G4 P2500
M106 S30
G1 E-[new_retract_length_toolchange] F1800
; FLUSH_END

; WIPE
SET_VELOCITY_LIMIT ACCEL=10000 ACCEL_TO_DECEL=10000
G0 X267 F24000
G0 X278 F2400
G0 X267 F24000
G0 X278 F2400
{endif}

{if flush_length_4 > 1}
;flush_length_4=[flush_length_4]
; FLUSH_START
{if flush_length_5 < 1}
M104 S[new_filament_temp]
{endif}
SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=5000
M106 S70
G1 F60
M400
G1 E{flush_length_4 * 0.18 + new_retract_length_toolchange} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F60
G1 E{flush_length_4 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F60
G1 E{flush_length_4 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F60
G1 E{flush_length_4 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F60
G1 E{flush_length_4 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F60

M400
M106 S255
G4 P2500
M106 S30
G1 E-[new_retract_length_toolchange] F1800
; FLUSH_END

; WIPE
SET_VELOCITY_LIMIT ACCEL=10000 ACCEL_TO_DECEL=10000
G0 X267 F24000
G0 X278 F2400
G0 X267 F24000
G0 X278 F2400
{endif}

{if flush_length_5 > 1}
;flush_length_5=[flush_length_5]
; FLUSH_START
M104 S[new_filament_temp]
SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=5000
M106 S70
G1 F60
M400
G1 E{flush_length_5 * 0.18 + new_retract_length_toolchange} F{new_filament_e_feedrate}
G1 E{flush_length_5 * 0.02} F60
G1 E{flush_length_5 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_5 * 0.02} F60
G1 E{flush_length_5 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_5 * 0.02} F60
G1 E{flush_length_5 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_5 * 0.02} F60
G1 E{flush_length_5 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_5 * 0.02} F60

M400
M106 S255
G4 P2500
M106 S30
G1 E-[new_retract_length_toolchange] F1800
; FLUSH_END

; WIPE
SET_VELOCITY_LIMIT ACCEL=10000 ACCEL_TO_DECEL=10000
G0 X267 F24000
G0 X278 F2400
G0 X267 F24000
G0 X278 F2400
{endif}

SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=5000
G0 X267 F2400
M8200 O