Job submit with --entrypoint-memory

I like to submit a job to ray and limit the memory used. I found that there is a flag --entrypoint-memory and tried submitting the job using the CLI with:

ray job submit --no-wait --entrypoint-memory 6 -- python /path/to/my/script.py --args=val

The job fails immediately with:

Job entrypoint command failed with exit code 2, last available logs (truncated to 20,000 chars):
python: can’t open file ‘/path/to/my/script.py’: [Errno 2] No such file or directory

Running the command without --entrypoint-memory is working.