Had this exact problem today.
The cause turned out to be bends in the microswitch cable that after repeated movements broke without external signs…
The problem would only show itself after removing the cable and intensely testing it.
Testing it in the box did not demonstrate the problem and I wasted another 4 hours before I came back to this as a possible cause.
I cut the cable, removed the connector on the switch with my soldering iron and soldered the ends of the cable (rather crudely) directly into the sensor.
I then removed two of the wire guides and left more wire hanging than before to allow for much less stressful movement.
I finished everything off with some zip ties and went back to printing.
Took me about 10 hours to troubleshoot but if I was on my game should have taken me far less.
Learned a lot about Gcode and the device during the course of things so it wasn’t all wasted time.
I hope someone else saves time by reading this.
I have requested replacement gear and a spare set of cables from Qidi.
Haven’t heard back from Fiona yet but I have no worries given their reputation I am sure things will work out well.
Micheal.