Just add a Z hop (e.g. “G1 Z40 F10000”) if the current height is less than the minimum height to clear the bed.
15mm is the maximum amount we use in the gcode generated by SimplyColor3D. Specifically for Prusa i3 MK3S.
Then we reduce that value with every layer by the layer thickness so as to use the least amount of time possible for purging.
Those z moves aren’t free 😉