The reason is that the name within the inputs is the same. So only one wins. You can set more parameters.
Following how it can be done:
I assume that the names of the bands are simply ‘band_1’
NodeDescriptor = jpy.get_type(‘org.esa.snap.core.gpf.common.MergeOp$NodeDescriptor’)
include_1 = NodeDescriptor()
include_1.setProductId(‘masterProduct’)
include_1.setNamePattern(‘band_1’)
include_1.setNewName(‘red’)
include_2 = NodeDescriptor()
include_2.setProductId(‘slaveProduct1’)
include_2.setName(‘band_1’)
include_1.setNewName(‘green’)
included_bands = jpy.array(‘org.esa.snap.core.gpf.common.MergeOp$NodeDescriptor’, 2)
included_bands[0] = include_1
included_bands[1] = include_2
parameters.put(‘includes’, included_bands)