I shared your above response with gravity forms. This was their response:
You have confirmed that enabling Wordfence makes the issue appear and disabling Wordfence resolves the issue, so there’s no issue with your PHP version, it’s working without issues with the same PHP version when Wordfence is disabled, so it’s clearly something that Wordfence needs to investigate and fix.
I also deactivated all plugins to narrow down the issue and to make sure nothing is conflicting. It only happens when wordfence is active and under the conditions, I described in my initial statement.
Can you please advise of a fix?