## Bug description

When you create a trend with two lines, one of which is say $pageview with a filter of browser = chrome and the other is ALSO $pageview but a different filter.

If you click on any the line you get the same users in the persons modal, even if you switch the trend line toggle in the modal.

## How to reproduce

1. Create a new trend
2. Add a $pageview trendline, and another $pageview trendline with a subfilter
3. Click on any of the lines
4. Open the persons modal and switch between the trend lines in the persons modal

## Environment

- [x] PostHog Cloud
- [ ] self-hosted PostHog (ClickHouse-based), version/commit: _please provide_
- [ ] self-hosted PostHog (Postgres-based, legacy), version/commit: _please provide_

## Additional context



#### *Thank you* for your bug report – we love squashing them!

posthog/api/utils.py
raw_included_definition_ids: Optional[str], is_property: bool, named_key: str
):
    
    if is_property:
        included_definitions_sql = f"(id = ANY (%({named_key})s::uuid[]))"
    else:
        included_definitions_sql = f"(id = ANY (%({named_key})s::uuid[]))"
    if not raw_included_definition_ids:
        return included_definitions_sql, []
    return included_definitions_sql, list(set(json.loads(raw_included_definition_ids)))
def safe_clickhouse_string(s: str) -> str:
    surrogate_regex = re.compile("([\ud800-\udfff])")
    matches = re.findall(surrogate_regex, s or "")
    for match in matches:
        s = s.replace(match, match.encode("unicode_escape").decode("utf8"))
    return s
def create_event_definitions_sql(include_actions: bool, is_enterprise: bool = False, conditions: str = "") -> str:
    
    ee_model = EnterpriseEventDefinition if is_enterprise else EventDefinition
    event_definition_fields = {
        f'"{f.column}"' for f in ee_model._meta.get_fields() if hasattr(f, "column") and f.column != "tags"  
    }