The only thing I found is this 'key' => $field['test'],
should be 'key' => $field['name'],
In my application I use the same filter for multiple fields and since ACF passes the field array to the filter you can get the field name from there rather than building a specific filter for each field. If you want the filer to only work on this field then the code should be 'key' => 'test',