Based on the log the used install command tries to download PyTorch 1.2.0 with CUDA9.2:
HTTP error 403 while getting https://download.pytorch.org/whl/nightly/torch_nightly-1.2.0.dev20190731%2Bcu92-cp36-cp36m-linux_x86_64.whl

I’m not sure, if you need to update pip, but the command properly downloads the latest nightly in my setup (I’ve created a new virtual environment to test it):
pip install --pre torch torchvision torchaudio torch-nightly -f https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html
Looking in links: https://download.pytorch.org/whl/nightly/cu111/torch_nightly.html
Collecting torch
  Downloading https://download.pytorch.org/whl/nightly/cu111/torch-1.10.0.dev20210831%2Bcu111-cp38-cp38-linux_x86_64.whl (2133.4 MB)