Your interior light switch on driver door frame that releases and extends when the driver door is opened is sticking closed I bet. Because of this sticky switch, the automatic off headlight doesn't realize that the driver door has been opened and closed.
Does the dome light come on when you open the door?
That should tell you if it is a door switch issue.
I haven't fully trusted the automatic lights for years.
Not because they don't work but because there have been numerous times one of us has turned the key to roll up windows or listen to radio and not been in the drivers seat to have to open the door to get out and not realized that headlights came on and didn't get shut off.
No REAL damage, just dead battery.