This relies on the fact that package-install handles package descriptor objects in a different way than when you just call the function with a package name. This would also mean that an alternative solution to this issue would be to tell users to evaluate (package-install (cadr (assq 'eglot package-archive-contents))) but I don't know how user-friendly of an idea this is.