APOC call custom function in another function

Is it possible to call a custom function in another custom function? This is an example of what i whould like to implement but i am getting errors .

CALL apoc.custom.declareFunction(
  'AQI(pollutant::STRING, value::NUMBER) :: STRING',
  '
    RETURN CASE
    WHEN $pollutant = "pm2.5" THEN return custom.aqi_2_5($value)
    WHEN $pollutant = "pm10" THEN return custom.aqi_10($value)
    WHEN $pollutant = "so2" THEN return custom.aqi_so2($value)
    WHEN $pollutant = "no2" THEN return custom.aqi_no2($value)
    WHEN $pollutant = "o3" THEN return custom.aqi_o3($value)
  END          
  '
);

dlyberis_0-1660860698416.png

Thank you in advance.

Try removing the ‘return’ clause on lines 5-9. That is not needed in the case statement