I would guess you have Z min end stop plugged into Z max endstop and configured incorrectly to work.
This would home and the printer would think i'm now at X0, Y0, Z200, then would move up to max z length to get to z0 before trying to print.
Check your endstops with M119, manually trigger (with your finger) the Z endstop at the bed, what does M119 say
z min triggered or z max triggered?