My get_terms not working for custom fields

The issue is with ACF as discussed here along with a solution: https://support.advancedcustomfields.com/forums/topic/how-to-use-wp-term-meta-on-acf-the-easy-way/

Courtesy of various posters there, the code I added to mu-plugins is:

function acf_update_term_meta($value, $post_id, $field) {
  $object = get_queried_object();
  $term_id = intval(filter_var($post_id, FILTER_SANITIZE_NUMBER_INT));
  if (!isset($object->taxonomy) || !isset($object->term_id) || $term_id != $object->term_id) {
    // the current object is not a term
    return $value;
  }
  update_term_meta($term_id, $field['name'], $value);
  return $value;
}

add_filter('acf/update_value', 'acf_update_term_meta', 10, 3);

function acf_load_term_meta($value, $post_id, $field) {
    $term_id = intval(filter_var($post_id, FILTER_SANITIZE_NUMBER_INT));
    if($term_id > 0)
        $new_value = get_term_meta($term_id, $field['name'], true);
    return $new_value ? $new_value : $value;
 }
 add_filter('acf/load_value', 'acf_load_term_meta', 10, 3);

One difference is that when loading term meta I check that a value is actually returned from get_term_meta and if not I return the original value. This serves to not loose existing meta values, and so that they can then be updated in the new way.

Note that these values cannot be queried until they have been updated in the new way, and this requires editing and saving all terms.

The final thing to note is that if the meta value is an object it appears that it is only the id can be queried.