To adapt the code you are using to categorize based on the expression suggested by @JGH, you actually need to create the list of unique values and QgsRendererCategory list based on the expression.
Please try the code below, adapted (and 'Pythonicized') from the logic in the addCategories() method of QgsCategorizedSymbolRendererWidget class which starts at ...
Instead of categorizing the data by intensity, you can categorized it by a concatenation of intensity and affected_p
The expression would be similar to "intensity" || ' - ' || sum("affected_p","intensity")
The example below use the average instead of the sum:
There are several options, but the most efficient will be to use a grouped reducer (there are detailed examples in the User's Guide at https://developers.google.com/earth-engine/guides/reducers_grouping).
It would look something like this:
// Create a raster of biomes
var biomes = ee.Image().int().paint(ecosystems, "biome").rename("biomes"...
According to this post, your problem is here:
<wps:Reference mimeType="image/tiff" xlink:href="http://geoserver/wcs" method="POST">