null-ls: failed to run generator: ... mypy: can't read file

hau*_*gar 6 neovim mypy

I have null-ls setup with nvim and have a mypy diagnostic in my sources that I run on save

null_ls.builtins.diagnostics.mypy.with({
 method = null_ls.methods.DIAGNOSTICS_ON_SAVE}),

Run Code Online (Sandbox Code Playgroud)

But as soon as I do, for example, nvim main.py, I get this error

[null-ls] failed to run generator: ...t/null-ls.nvim/lua/null-ls/helpers/generat
or_factory.lua:218: error in generator output: mypy: can't read file '/Users/me/main.py': No such file or directory
Run Code Online (Sandbox Code Playgroud)

The error disappears if I save the file and go back inside it.

Is the diagnostic running as soon as I open the file, even though I have it on save? btw, I don't get this error at all with black or flake8 which I also have configured in sources.