The reason is that Retool uses parameterized queries and it does not execute most javascript before passing the value to the parameter. Seems like {{}} can only "return" a boolean or one of Retool's model property values.
So it can understand {{select_source_feed_select.value}} or {{!filter_matched_only.value}} as they can return a simple value which Retool places into the parameter, but filter_matched_only.value ? 'i.is_matched = 1' : 'i.product_id IS NOT NULL' is incomprehensible so you get an error. Rather than get no results, you should have received an error. I get "An expression of non-boolean type specified in a context where a condition is expected" when I try something similar.
As a result, you need to use SQL to handle your logic, rather than Javascript, which is exactly what you did in your final version.
I'm sure one of the support techs can give more complete explanation, but this is my observation of how this all works.