Inconsistent minimum depth / IR autoexposure?

I get very inconsistent minimum distances from my Astra Pro. Sometimes I can get almost as close as the advertised 40cm before the depth measurement turns invalid. Sometimes it’s more than 1 meter. I guess it depends on ambient light (no direct sunlight, but it seems to be worse when the sun is shining outside).

In the IR image you can see it’s saturated, so it’s not really surprising that the depth doesn’t work. But shouldn’t there be some automatic exposure adjustment for the IR camera? Or is there a way to manually do that?