Hmmm... this is nothing I have to look for. Foreground, location and battery is not what this issues.
I may explain a bit more:
This is an Adnroid car unit based on an RK3399 (PX6).
The issue nearly all owner of these units have is, that Tasker get´s killed when going into deep sleep.
Problem is here, that even the Accessibility settings are changed to denied on wake up.
I already built an app which activates the accessibility settings on reboot, but it is still an issue that Tasker is not "ativated", will say: there are no active profiles, independent what I choose as a trigger.
To "repair" that, I have to open Tasker and press the check mark button to get profiles working.
Sometimes it works with another app created with Tasker to start Tasker, give it some seconds, check the return button twice and go home.
Then I can see that tasks are activated and stuff in the background is working... mostly at least, not always.