It's likely that the initrd in the installation system exceeds the memory reserved by the UEFI firmware. To deal with different systems, the initrd of the installation system is usually much larger than the normal one. When grub2 measures the files, due to the requirement of TPM measurement, it has to load the entire file into the memory. Some UEFI firmware only initializes a portion of the memory, probably for the fast boot, and it may not provide enough space for the large initrd. As a workaround, you could disable TPM during installation and enable it again later to circumvent the memory issue.