Yes, there is. Just like NPM's left-pad case.
The owner of the package remove the package from the repository. It doesn't matter if you pin to any version if there is no longer a code to download.
The only way to prevent this is to have your own local server for third party package repository.
The only way to prevent this is to have your own local server for third party package repository.