Need help with p5GUI in instance mode

because you cannot pass a variable name to addObject. You need to wrap it around by another object, and pass the object to addObject:

https://editor.p5js.org/micuat/sketches/B-FKdzlQJ

(for demonstration I added only numShapes but of course if you add other parameters to param they will show up in gui)