This is a consequence of #34653, so maybe it's working as intended. We treat an argument ending with .go as a package path, not a source file, if the source file with that name doesn't exist. That's necessary for github.com/nats/nats.go.
The error message from go build is not wrong: main.go could be either a file, or a package (perhaps one provided by a local proxy, workspace, or replace directive).
That said, we should probably not suggest go get on a path ending in .go (since the cause is more likely to be a missing file than a missing package), and we probably should mention no such file: there are two possible interpretations of the argument, and we should explain why both interpretations fail.
The error message from go get main.go does look outright wrong: go get should not assume that paths ending in .go are file paths, and AFAICT main.go is also valid module path. So it's fine for go get main.go to report that main.go does not exist as a file, but it also ought to see if a module main.go exists.