Problems using Field Filters on MongoDB using Native query

Hi guys, I've read some topics about this before and I tried to solve this but it didn't work.
I'm having this error when I try to add a Field Filter in my query:

If I use a hard-coded filter, it functions correctly, and it also works in my views generated by the question. The issue only arises when using a native query. What am I doing incorrectly?

instead of {"$match": {filter}} use directly {{filter}}