Classic example of incorrect or absent E-Stop circuit.
The E-stop should be held off until the Charge pump is active, and then the cycle start P.B. or enable P.B. is operated, picking up the E-Stop relay.
The E-stop relay is a hard wired circuit that picks up the ready relay which in turn powers up any P.S. for servo's steppers, and the VFD or spindle/relay contactor.
The Ready relay also advises Mach that it is active via the E-stop input pin.
This is normally standard practice in industrial machines and commonly absent from DIY versions.
Al.