Then start from scratch, to find where the problem lies. First check if the machine recognizes correctly the Z0 / top surface/ across all 4 corners. Then you will know that the controller functions ok. There are not many possibilities. if the table is surfaced, the controller is ok, then is something mechanical or software. Eliminate the mechanical by revising and pushing around, looking for some play, if not - its software. Search a previous job that you know has OK code and check.