In SNAP Desktop the valid pixel expression of the target band is set based on the valid pixel expressions of the input bands. This is not done by the operator.
Check the valid expression of the target band and you can use it in your python script as parameter. Right-click on the band and select Properties.
