João, I don't have Emacs git access so I'll write the equivalent comment and commit message here.
-----
(project-files-relative-names nil) ; override global to ensure directory components are retained
(dirs-to-watch
(delete-dups (mapcar #'file-name-directory
(project-files
(eglot--project server))))))
-----
"project.el has a global, project-files-relative-names, which influences project-files to return results without parent directory prefixes and this causes file-name-directory to fail to detect directories at the root of the parent. We disable project-files-relative-names to ensure complete results."