screen -d -m time python3 myscript.py runs
python3 myscript.py inside a screen session, then exits. If you don't see that screen session later, it's because the script has already exited.
It seems that you expected
myscript.py to run for longer. Something must have gone wrong. Redirect the output (especially errors) to a file to see what's going on. Or keep the session around by running another program.
screen -d -m time sh -c 'python3 myscript.py; echo $?; sleep 999999999'
If the script doesn't work when you run it directly from screen, but works if you run it from an interactive shell, it's very likely that this indicates two things:
myscript.py relies on some setting, probably an environment variable. It isn't self-contained.
- You're setting this setting in the wrong place. You're probably setting an environment variable in
.bashrc, which is only read by interactive shells. Set environment variables in
.profile instead; this file is read when you log in.