This answer is a bandage, not a cure, but perhaps it will be enough in your
case...
The first moments of operation when a system (especially a server) is
booting up are replete with programs demanding resources which may not be
available yet. I found that simply adding a Python time.sleep() call
Has anyone dealt with Python based Windows Services not starting properly
at system boot? They start immediately after boot, but not at boot.
Attempting to use various dependencies to make it start up later in the
process hasn't seemed to help.
I have to separate codebases that exhibit this