Craft 3 - Programatically get all the values contained in a field of type category
Your field contains an object of type ElementQuery in order to get all Categories you'll need to execute it.

$categories = $element-&gt;getfieldValue('productTheme')-&gt;all();
$categoryTitles = [];
for($categories as $category){
    $categoryTitles[] = $category-&gt;title;
}


Please read the documentation