You have
'terms' => 'terms' => get_terms( 'brands', array( 'fields' => 'ids' ) ),
when it should be
'terms' => get_terms( 'brands', array( 'fields' => 'ids' ) ),
Unless that is a typo when adding your code example?
You have
'terms' => 'terms' => get_terms( 'brands', array( 'fields' => 'ids' ) ),
when it should be
'terms' => get_terms( 'brands', array( 'fields' => 'ids' ) ),
Unless that is a typo when adding your code example?