My Z endstop was getting bent down for some reason, and this caused numerous problems, both subtle and dramatic.
1) The height of this block is specific to my printer's bed height, nozzle length, and Zendstop screw adjustment. Which may not be - but should - be correct for any i3 mega. But adjusting your z endstop adjustment screw should compensate for most small differences.
2) The endstop switches supplied by anycubic have 2 vertical screw holes, whereas standard reprap style sensors on ebay etc all seem to have 2 horizontal screw holes.
As per the comments, I used (iirc) four M3x8mm to mount it.
Pairs with this mirrored left side mount:
I haven't used these for months. Do yourself a favour and flash firmware with dual z endstops and print 2 endstop brackets for that. Using the mega with only one endstop is massochistic. Don't do it.