Hey Paul,
I tried this today and experienced the same issue you described. I took a closer look at the underlying REST request and the culprit was the value of the layers parameter, which looked like this: "[0,1,2,0,1]" (notice that layers 0 and 1 are in there twice). The following code adds to the GenerateGeodatabaseParams.LayerOptions, but those layers (and one more) are already defined by default:
generateGdbParams.LayerOptions.Add(new GenerateLayerOption(marineLayerId, dolphinsOnlyWhereClause));
generateGdbParams.LayerOptions.Add(new GenerateLayerOption(birdsLayerId));
So ... you just need to clear the LayerOptions before adding to them:
generateGdbParams.LayerOptions.Clear(); //<--Do this before adding to the layer options
generateGdbParams.LayerOptions.Add(x);
generateGdbParams.LayerOptions.Add(y);
I also found another glitch "downstream" from this that you might hit. When creating the layer from one of the output GDB tables, you need to make sure you load the table first, otherwise you'll get an exception when trying to read properties (such as the Name of the table):
// get the first table
var gdbFeatureTable = gdb.GeodatabaseFeatureTable(0);
await gdbFeatureTable.LoadAsync(); // <--Load it!
// create a FeatureLayer to display the table
var localGdbLayer = new FeatureLayer(gdbFeatureTable);
// name the layer with the table name
localGdbLayer.Name = gdbFeatureTable.TableName; //<--exception here if it's not loaded
Apologies for the frustration, we certainly should have caught this before putting it in the doc. Thanks for pointing it out ... at least we can save the next person some stress! Please let us know if you hit anything else.
Thad