@dank0 did you correct that G90 to G91 as @fcwilt pointed out?
Please post your homex.g, homey.g and homeall.g files too.
BTW your Z homing script is incorrect - although I don't think that is the cause of your issue with re-homing X and Y. When using a Z probe for homing, you should home Z using a G30 command, not a G1 H1 command, and you do not need to define a Z endstop using M574. See https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Homing_Z_using_a_Z_probe.