Screen auto lock on iPhone does not work
I had the same problem with my iphone 8 and this morning kept googling answers thinking it was a major problem.  Then I have restarted the phone and it now works.  Should have done this first! lol