To reproduce, the following query can be used:
select distinct first_value(t) over ( partition by si order by i, b ) from over10k limit 100;
The distinct keyword is ignored and duplicates are produced.
first_value can't have more than one order by column
Fix DISTINCT with windowing when CBO is enabled/disabled