From what I know, limit switches should not be connected to the same input pin as the E-Stop and axes with home switches should also be on separate input pins.
In my machine I have all limits / home for Y & A to one input pin, X & Z to another input pin, the E-Stop to another input pin, and the Auto Zero for the Z axis to another input pin.
To assure that all switches are assigned the correct pin I use the “Automated Setup of Inputs” from the Config Menu, Ports and Pins, Input Signals Tab. This way Mach sets all as needed and all work perfect.