Spring Data JPA @Query not working (findAll + filter works)

I have a custom @Query which returns 0 results when I try to filter data using HQL (should return 1 result)

@Query("SELECT ...
FROM ...
WHERE ...")
Set<SomeObject> find...(@Param("param") String param,...)

but when I use repository.findAll() and filter the data using streams in Java I get the result I need. FYI I filter the data using exactly the same conditions as in the query.

Any ideas why this happens?