remove: improve error message when trying to remove a package from a project without any dependencies (#9918)