How to add field content as class in Twig?
item.content works only in the items loop, but don't try to put rendered output in a class name. Use the field value instead, which you can get through the field object #items stored in a field template inside of the variable element:

{{ element['#items'].value }}


or from a different field of the parent entity:

{{ element['#object'].field_example.value }}


Depending on the field type replace .value with a different property, for example for a reference field to get the target id or the label of the target with .target_id or .entity.label.

When you have found the field value build your class name:

{%
  set classes = [
    ...
    'icon-' ~ element['#items'].value|clean_class,
  ]
%}