Attaching a file to a CRM Deal through Flow

Attaching a file to a CRM Deal through Flow

We have a Flow that is grabbing particular emails from an inbox, running them through Flow's DocaMatic interface and converting them to a PDF, then we're trying to attach them to a Zoho deal. This last step we're trying to accomplish with this following custom function:

map attachFiletoDeal(int dealID, string pdfURL)
{
pdfFile = invokeurl(pdfURL,"GET");
return zoho.crm.attachFile("Deals",dealID,pdfFile,"zoho_crm_connection");
}

All of the steps of our flow succeed, including the last one which is a call to this function. From a successful history entry, here is the input:

{
        "dealID": 2500568000043526001,
        "fileID": "https://docamatic.s3.eu-west-1.amazonaws.com/prod/11781570-e8b5-4b5f-ba89-5ad9606763e2/01beeb65-0de7-4259-bb69-d8563d53ba89.pdf"
}

The fileID was verified to exist (though it gets deleted after 24 hours).

Here is the very odd output:

{
        "attachFiletoDeal_7": null
}

Why would zoho.crm.attachFile() return null?

What is weirder is when I "Execute" the function from within Zoho Flow and manually enter the exact input values above, it attaches the file!!

Can anyone please help me figure out what's going wrong?