2014~2021 Leaving home light problem

Hi guys!
I have a very strange problem with my 2017 Mazda 6 leaving home light function.
Basically the function is working after driving if I unlock the car in under 2min after locking the car, headlights will turn on. But if I come back to the car lets say 10min after locking the car, the leaving home lights wont turn on when unlocking the car.
I really cant understand what the problem possibly could be.. Does anyone know what possibly could cause this?
 
Back