I’ve encountered this issue when installing a module that has a different certificate than the previously installed version.
This happens to me pretty regularly because my CI builds use a different cert than my local builds.
You get the popup to accept the cert, but after pressing “Accept Certificate” you get a “Certificate Already Accepted” error, and the module fails to install.
The current solution is to uninstall the existing module, restart, install the new module, restart.