Using 'Custom' type in Number Card

I am trying to create a new Number card and have selected Custom.

I have written a server script and am calling it in Number Card using method.

I am not sure what I am doing wrong and exactly how the output is expected as I keep getting ‘undefined’ in number card

I am currently returning as the below format in my script:

value = frappe.format_value(calculation, {"fieldtype":"Currency"}); 
return {
        "value":value,
        "fieldtype":"Currency"
    }

It is working fine when I test in system Console, check below output:

{‘value’: ‘L.E 24,385,462.87’, ‘fieldtype’: ‘Currency’}

Would really appreciate if I get any assistance in what am I missing or doing wrong.

Regards,