I need a sensor that is able to differentiate between distance 20mm and 23mm with no error.
i.e. the accuracy and stability must be high (within 1mm only)
which sensor should I use VL6180 or VL53L or something else?
Ouch that's a hard one. All the ST Time of Flight sensors return about +/- 3%. So clearly that is outside your limit. But buy the VL53L1X evaluation kit. Go with a very long integration time - (timing budget). If you can condition your target (and it's not some random thing, you should be able to get close. I have a customer doing a medical device with the VL53L0X and he gets within 2mm. So if you have a consistent distance, and a consistent target, you should be able to come very close.
As a rule the ToF sensors can be low power, high accuracy or long distance. But you only get one of those.
In your case, you didn't mention power, need high accuracy and aren't worried about distance.
So go with the VL53L1X and use a long timing budget.
Retrieving data ...