I ran into this specific problem now recently, and it was causing random problems which was hard to pinpoint. We have gradle custom tasks that executes java code with parameters (instead of using a main), the library called in this code relied on some updated environment variables.
After some serious bug hunting, we started to suspect that the environment wasn’t properly transferred/updated from gradle to the java code (and its sub processes). When we finally we disabled daemon with --no-daemon everything worked.
This was with gradle 6.3. Would like to see that the env was consistent between the daemon and the launcher…