Understanding custom filter

Good afternoon. I do not understand the logic of custom filter. I want to create a filter that will leave me 2 entries.
This part:
((diff_days(date(2019,09,25), ${table.datetime_date}) > -1) AND (diff_days(date(2019,09,25), ${table.datetime_date}) < 1)) gives me 2019-09-25.

This part:
((diff_days(${table.datetime_date}, date(2019,09,25)) > 364) AND
(diff_days(${table.datetime_date}, date(2019,09,25)) < 366) AND
(extract_years(${table.datetime_date}) = (extract_years(date(2019,09,25))-1))) gives me 2019-08-25.

But this:

((diff_days(date(2019,09,25), ${table.datetime_date}) > -1) AND (diff_days(date(2019,09,25), ${table.datetime_date}) < 1)) OR
((diff_days(${table.datetime_date}, date(2019,09,25)) > 364) AND
(diff_days(${table.datetime_date}, date(2019,09,25)) < 366) AND
(extract_years(${table.datetime_date}) = (extract_years(date(2019,09,25))-1))) gives me more than 2 entries. And I don’t understand why is it. And for me, equalization does not work.

looks like a bug
when I take the SQL and I enter it into SQL runner it works

When I try this, I’m getting entries for 2019,09,25 and 2018,09,25. What other entries are you seeing? Knowing what the other entries are will likely be helpful to figure this one out— It sounds like it might be grouping related.