Add an additional Check for the error case "Invalid reading (Ambient light too high/Target surface too reflective)" as described in the user manual chapter 6.2. to the I2C examples.
Currently this case is not treated and just returns the distance 1 which seems in the output as a regular distance measurement, but is in fact an error.