The value of $args is the same thing you’re using in $terms = get_terms(['taxonomy' => 'yst_prominent_words', 'hide_empty' => true]);
what you need to return here is the arguments that ACF will use when it calls get_terms()
.
But if you only want to show terms in a single taxonomy why not just set that taxonomy in the Filter by Taxonomy
setting for the field?