plugin.install and plugin.remove count an entry of grants.json that this version can't use when it can't be removed. plugin.install stops counting a grant it can't remove when the old module can't be written back to the Plug-ins folder.