Interesting. It doesn't come from RStudio, but R. I can reproduce the problem on Windows with R4.2.x; the download works properly on R4.1. This coincides with the switch of default download method from wininet to libcurl, and indeed these work:
Looking at the source code of download.file(), using method = curl uses system() to call curl in the OS, whereas method = libcurl uses a C function (part of R source), called curlDownload(). We can check the version:
So, either it is a bug in libcurl 7.83.0 that was corrected in 7.83.1, or it is a bug in R's code calling libcurl. You can check if you have the same versions.