This is an error either in Homebrew or the runner image (version 20241119.509). The latest runner image (20241022.361) fixes this, it is being deployed right now. Deployment is a long process, so it might still be happening for some time.
EDIT: Actually, this is backwards. 20241022.361 was ok, 20241119.509 broke the install. But the latest release of r-lib/actions@v2
fixed this.