File path variable not getting resolved

when i use conditional way to set file path it throws error

config_serverless_path:
    cs: ${file(.cloudos/pimdbmig-cloned/service_config/${param:security_zone, 'dev'}/${param:stack_name, 'dv'}/${opt:region, 'us-west-2'}.yaml):pimdbmig-lambda-cloned.serverless_config}
    default: ${file(.cloudos/pimdbmig/service_config/${opt:region, "us-west-2"}.yml):pimdbmig-lambda}

  cloudos_config: ${self:cutom.config_serverless_path.${param:stack_name},self:cutom.config_serverless_path.default}

it throws error
Error:
Cannot resolve serverless.yml: Variables resolution errored with:

  • Cannot resolve variable at “custom.config_serverless_path.default”: Value not found at “file” source

need help what is reason for this and how to fix it