It looks like a software issue. By dialing *#0*# The test sensor accurately reads the distance between the phone and an object. It just doesn't identify that it needs to adjust the screen.
For now I have turned off the screen black out feature until there is an update. I switch the screen off...