Not completely clear what is happening here, what make/model of machine is this? It sound like you are still having movement when the e-stop is pressed?
If so, one reason is if the e-stop cuts off power to a AC side of a power supply and there is a delay while the DC decays allowing the motors to take off in an uncertain direction until the voltage has decayed sufficiently.
Without more info it is just a guess at this point.
Al
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.