Grafana Query error when using expressions

Using Fly hosted Grafana, every time I add an expression to a query, I get a “Query data error” (500 Internal Server Error). If I remove the expression the error goes away. Any idea of where this error comes from?

Here’s a simple math expression that instantly causes the panel to crash:

{
  "request": {
    "url": "api/ds/query",
    "method": "POST",
    "data": {
      "queries": [
        {
          "datasource": {
            "uid": "prometheus_on_fly",
            "type": "prometheus"
          },
          "editorMode": "builder",
          "exemplar": false,
          "expr": "sum(some_metric)",
          "instant": false,
          "legendFormat": "Some Metric",
          "range": true,
          "refId": "A",
          "interval": "",
          "expression": "",
          "window": "",
          "datasourceId": 11057,
          "intervalMs": 15000,
          "maxDataPoints": 2056
        },
        {
          "datasource": {
            "uid": "prometheus_on_fly",
            "type": "prometheus"
          },
          "editorMode": "builder",
          "expr": "sum(some_other_metric)",
          "hide": false,
          "legendFormat": "Other Metric",
          "range": true,
          "refId": "B",
          "interval": "",
          "expression": "",
          "window": "",
          "datasourceId": 11057,
          "intervalMs": 15000,
          "maxDataPoints": 2056
        },
        {
          "refId": "C",
          "datasource": {
            "type": "__expr__",
            "uid": "__expr__",
            "name": "Expression"
          },
          "type": "math",
          "hide": false,
          "expression": "$A + $B",
          "window": ""
        }
      ],
      "range": {
        "from": "2023-02-25T02:45:31.485Z",
        "to": "2023-02-25T08:45:31.485Z",
        "raw": {
          "from": "now-6h",
          "to": "now"
        }
      },
      "from": "1677293131485",
      "to": "1677314731485"
    },
    "hideFromInspector": false
  },
  "response": {
    "message": "Query data error",
    "traceID": ""
  }
}