I was working with a circuit measuring 4-5 meters with an ultrasonic sensor.
But no matter what you do with the ultrasonic sensor design, you can not measure below 20 cm
That's to be expected - at 20cm the roundtrip time of the "ping" is only around 1ms. That's very difficult to measure with any reasonable accuracy using the cheap ultrasonic sonars.
VL53L0X - that is a laser ToF sensor, meant for range finders up to 2m. Maaasive overkill, IMO, and may not work well at the short distance neither. Datasheet doesn't specify it but their graphs don't go below 50mm, curiously ...
RFD77402 - another ToF sensor, 100mm minimal distance.
TSSP77038 - these two are IR remote control receivers, that's not useful for what you want.
TSSP4P38
What would you recommend of these / out of these?
None of the above. The ToF sensors are a massive overkill and quite expensive ($2.56@5k), fairly esoteric components. Moreover, they are also not designed to work at short distances, e.g. RFD77402 does not work under 10cm.
A simple solution is a LED + phototransistor measuring amount of the reflected light. And then you calibrate the measured intensity to give you distance. It is not totally universal, different surface colors and finishes will make the measured distances vary, but that is true even for the expensive ToF sensors. This is a commonly used method for sensing short distances - e.g. the Roomba robots use it to detect obstacles and to slow down instead of slamming into them at full speed. If you don't need superb accuracy then this is hard to beat on cost and simplicity.
If you want higher accuracy and the object you are measuring is conductive, then inductive or capacitive sensing can be used too. You can get plenty of industrial sensors like that, ready to go.
Another option is using a camera + laser, the idea how that works is explained here:
https://sites.google.com/site/todddanko/home/webcam_laser_rangerThese are best at exactly short distances where you have the most resolution. If you don't want to put a camera there, it is possible to do it with a linear CCD (like the ones used in scanners). One such project is described here:
https://hackaday.io/project/9829-linear-ccd-moduleThese range finders have good accuracy, but it is a bit complicated build.
However, you didn't provide enough detail of what are you trying to measure, so it is difficult to give you a more precise advice.