Interesting! I usually do exactly the opposite when I can. E. g. in Bash I would rather do this:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/docker.gpg \
> /dev/null