Can you jog the X axis without errors (e.g. in Slow, Continuous jog mode, without trying to home the machine first)?

If not, then it is probably a servo drive or servo power problem, or a problem with the limit switch cable connection to the drive. Your next step would depend on what model M400 you have.

If you tell us your control serial number, then we would have a pretty good idea what model of M400 you have. The control serial number will be on the back or side of the console, and also on the door of the electrical cabinet. It will probably be in either the 6000 series for an original M400; 10000 series for a Uniconsole-2 M400; 20000 series for a Uniconsole-2 M400S; or 100000 series for an MPU11-based M400.

If you can move the X axis without error, but you cannot move Y or Z, then you might again have a servo drive problem or a problem with the limit switch cable connection to the drive.