I experience some errors when processing complex polygons. I realised that if I disable the Morton optimisation, then the errors go away.
I studied one of the cases and it seems that when using the optimisation, it is possible to create triangles with points inside of them (see picture attached). There is a point just on the edge of the triangle. When disabling the optimisation, such a triangle is not created.