That sounds like you should decrease either your acceleration, your instantaneous speed change setting, or both, for your z axis. As well, you should determine a maximum speed for that axis and set it appropriately. Ideally, any g-code should result in a permitted amount of movement without error, even if the gcode requests parameters outside of the physical viability of the printer mechanics.