Inline bind values for sub-queries

Generated sub-query for Relation as array condition for `where` method
did not take in account bind values of the Relation.
Fixed by inlining bind values into the sub-query.

Closes: #12586