The bar chart shows normally however when I enter a formula the query errors.

See the following video for steps to reproduce: https://share.cleanshot.com/gYbA6F

Link to the insight: https://app.posthog.com/insights/eswxiLCU/edit
posthog/queries/trends/util.py
from datetime import timedelta
from typing import Any, Dict, List, Optional, Tuple, Union
from rest_framework.exceptions import ValidationError
from posthog.constants import WEEKLY_ACTIVE
from posthog.models.entity import Entity
from posthog.models.event.sql import EVENT_JOIN_PERSON_SQL
from posthog.models.filters import Filter, PathFilter
from posthog.models.filters.utils import validate_group_type_index
from posthog.models.property.util import get_property_string_expr
from posthog.models.team import Team
from posthog.queries.util import format_ch_timestamp, get_earliest_timestamp
MATH_FUNCTIONS = {
    "sum": "sum",
    "avg": "avg",
    "min": "min",
    "max": "max",
    "median": "quantile(0.50)",
    "p90": "quantile(0.90)",
    "p95": "quantile(0.95)",
    "p99": "quantile(0.99)",
}
def process_math(