The problem with this action is, that the simple placeholder %field% always refers to the first value of a possibly multi-valued field.
So in your case, $trim(%genre%) assigns the trimmed first value of the genre field to the genre field.
This probably workedTM in some cases in the past, because Mp3tag didn't apply any changes if the first value didn't change. See this entry from the changelog and the related topic for details:
FIX: action 'Format value' did not apply changes for multi-value fields if first value stayed the same. (#44428 )
An option to trim leading and trailing spaces via Format value for multiple values would be
$regexp($meta_sep(genre,'\\'),'(^|\\\\)\s+|\s+($|\\\\)',$1$2)