It's absolutely possible! Just use:
renderer.updateColorRamp(QgsRandomColorRamp())
I modified your script only very slightly:
layer = iface.activeLayer()
field_name = 'zona_manejo'
field_index = layer.fields().indexFromName(field_name)
unique_values = layer.uniqueValues(field_index)
category_list = []
for value in unique_values:
symbol = QgsSymbol.defaultSymbol(layer.geometryType())
category = QgsRendererCategory(value, symbol, str(value))
category_list.append(category)
renderer = QgsCategorizedSymbolRenderer(field_name, category_list)
renderer.updateColorRamp(QgsRandomColorRamp())
layer.setRenderer(renderer)
layer.triggerRepaint()
See results on a test layer below (I changed only the field name to 'reg_code_8'.
Before:
After:
Incidently, because random colors are the default for the categorized renderer, you don't even need to update the color ramp. You can just use:
layer = iface.activeLayer()
field_name = 'zona_manejo'
field_index = layer.fields().indexFromName(field_name)
unique_values = layer.uniqueValues(field_index)
category_list = []
for value in unique_values:
symbol = QgsSymbol.defaultSymbol(layer.geometryType())
category = QgsRendererCategory(value, symbol, str(value))
category_list.append(category)
renderer = QgsCategorizedSymbolRenderer(field_name, category_list)
layer.setRenderer(renderer)
layer.triggerRepaint()
It will give you random colors. However, interestingly I foundnotice that the resulting palette is consistently a bit different (colors are not as 'vibrant'). An example: