Inconsistent behavior when renaming a dashboard using awscli vs boto3

I am trying to programmatically rename dashboard. I first tested this using the awscli utility which worked fine:

  1. aws quicksight describe-dashboard-definition --aws-account-id … --dashboard-id …
  2. take the output json, extract the “Definition” object as-is, and feed it back as follows:
  3. aws quicksight update-dashboard --aws-account-id … --dashboard-id … --name=“new name” --definition=“$(cat definition.json)”
  4. aws quicksight update-dashboad-version …

This works as expected. When I try to replicate the same procedure using boto3, (extract the definition, pass it back to update_dashboard(AwsAccountId=…, DashboardId=…, Name=…, Definition=result[‘Definition’]),
The dashboard fails to create (CREATION_FAILED status). When I check the errors via aws quicksight describe-dashboard I see the following:

            "Errors": [
                {
                    "Type": "INVALID_CALCULATED_COLUMN_EXPRESSION",
                    "Message": "Calculated field % Had HG Visits or Phone Notes w/in 10 Days Post-Escalation failed with error code CONTEXTUAL_UNKNOWN_SYMBOL during validation",
                    "ViolatedEntities": [
                        {
                            "Path": "calculated-field/% Had HG Visits or Phone Notes w/in 10 Days Post-Escalation"
                        }
                    ]
                },

The definition.json and the json I am passing via boto3 match exactly. What could be causing this inconsistency in behavior?

just to clarify: definition.json is just generated from:

aws quicksight describe-dashboard-definition --aws-account-id $AAI --dashboard-id=$DID | jq .Definition > definition.json

@Alex2 ,

what is the calculated field here ? Can you post the details ?

Kind regards,
Koushik