@moris I suspect that the wiring between the endstop and the Duet is incorrect. Please provide photographs showing how you have connected both ends of the cable.
@creamofpantssoup It would be best to start a new thread and provide as much detail as possible including your config files and firmware versions and details of wiring.