Hi Ard,
As per discribed in the commit message, this issue is seen on actual hardware and the fix is merged:
https://github.com/tianocore/edk2/commit/bfefdc2c49ca9487b7aa0df196b2aca6c0c170a2
Since this function is the exact duplicate of the one in UefiPayloadPkg, he figured to port the fix here as well to prevent future issue.