Meta query is an array containing arrays and not only one array (you can set multiple queries). So it should be:
$meta_query = [ [
'key' => 'codigo_de_barra',
'value' => $searchStr,
'compare' => '=',
] ];
Meta query is an array containing arrays and not only one array (you can set multiple queries). So it should be:
$meta_query = [ [
'key' => 'codigo_de_barra',
'value' => $searchStr,
'compare' => '=',
] ];