Rebuilt Foreman discovery image tries to boot incorrect filenames

Problem:

After rebuilding the Foreman discovery image using this script, the image fails to boot. The error reads “Loading vmlinuz0... failed: No such file or directory

After changing vmlinuz0 to vmlinuz and changing initrd0.img to initrd.img the image boots.

Expected outcome:
The image boots with no changes.
Foreman and Proxy versions:
N/A
Foreman and Proxy plugin versions:
N/A
Distribution and version:
N/A
Other relevant data:

Starting image is: fdi-4.0.3-a86d8b3.iso from here.
The full rebuild command was: ./discovery-remaster fdi-4.0.3-a86d8b3.iso "proxy.url=https://10.113.2.54:8443 proxy.type=foreman fdi.pxauto=1"