I did not yet try yet to search based on object attributes, what comes to my mind quickly, is that it is required to rebuild the search index for elasticsearch.
Did you run zammad run rake zammad:searchindex:rebuild after setting up the attribute and inserted data?
Looking at other forum posts, custom attributes should be searchable