Hi Chary,
I'll start with a disclaimer that I don't have a perfect understanding of the "balance" operation intuition. It is useful but it seems it indeed has limitations and in particular it doesn't work as expected with GROUP BY statements. I think I have seen this mentioned explicitly but couldn't find now, at least in the official docs here:
https://beancount.github.io/docs/beancount_query_language.html, only a hint "Access to the previous row is not a standard SQL feature" suggests that it might not work as expected.
In your example the issue is not that it doesn't respect the WHERE filter (I think it does) but that it aggregates balance between different accounts. That will become more obvious if you change 1000 EUR to different amounts (say, 500, 600 and 700) in your example transactions.
The partial solution to this is to explicitly use account ~ 'Assets:Bank2' in filter. This allows to get total balances for the particular account or the group of accounts that you specify in the filter. For example, in this case just removing "account" from SELECT will make the query calculate correctly the net worth across all Assets+Liabilities.
However, I'll also add that at very least the output of the query (when it includes "SELECT account") seems counter-intuitive to me, if not incorrect. Not sure if there is at least a way to display a warning if some groupping is about to happen that is not related to date groupping (I'm not sure about balances inner workings but it seems it's optimised for that).
P.S. If you choose to try a query for reporting periodic balances, like the one I've sent in the neighbouring thread or the one from the fava-dashboards repo example, you'll also likely to come across another unrelated issue:
https://github.com/andreasgerstmayr/fava-dashboards/issues/28#issuecomment-2573181426 that the rows will not be generated unless there's at least one transaction present in the time period. Leaving it here just in case.
Best,
Vasily