Where clause with parent property argument

When i put fixed value in where clause it works fine,

but when i put method argument return is empty.

What can be a problem? In this logic I filter my objects with property from parent table…

If you transfer in the argument the same value you use in hardcoded version – the result should be the same.
Try to log somewhere the resulted query (from the second variant), maybe some extra characters got there. And check how the argument “tr” looks like, when is used in the code.