'TEXT' can not be cast to '[BIGINT]' for the function 'get'

'TEXT' can not be cast to '[BIGINT]' for the function 'get'

Custom module in CRM where a user can enter data and click Submit. This is an annual project so it has not been touched in a while. The code behind the Submit button worked last year but not this year.

Here is the first few lines of the code, which is failing right at the beginning. 

apsiId = apsiIdStr.toLong();
apsiDetails = zoho.crm.v1.getRecordById("CustomModule8",apsiId);
apsiQty = List();
apsiQty.add(ifnull(apsiDetails.get("Product AB AC").toString(),"0"));

I get this error: 'TEXT' can not be cast to '[BIGINT]' for the function 'get'

I have read the toString() documentation and googled this error message. 

What is causing the error?