This appears to be caused by a recent update to the iPXE repo on Github. Here is a link to someone else encountering the same error:
https://github.com/ipxe/ipxe/discussions/1126
According to the thread above, build 6ca597e will not cause this error, which is the build before the one that gives this error. Therefore I added the line “git checkout 6ca597e” in the buildipxe.sh script after the git pull lines for the iPXE and iPXE-efi repositories. This allowed me to compile the binaries via the script without errors. I hope this helps if you come across this error!