The cause of the error is due to the fact that there is no way to specify linearly in the command line the variables (names and expressions) that are actually the bands extracted from the source product. Therefore no band gets extracted from the given source product, and this is causing the crash after.
The only way to specify the collection of variables structure is using the XML graph.
You can define external variables and use them inside the graph. See an example below:
graphMultiSizeMosaicOp.xml (1.9 KB)
In this example, I have set $var1BandName=“B5” and $var1BandExpression=“B5”.
After, the graph itself can be run in command line, using gpt (“gpt \path\to\graph.xml”).