Hi,
Please construct the pipeline in gst-launch-1.0 command with fakesink. To ensure it works in gst-launch-1.0 first, and then apple to C code by replacing fakesink with appsink.
Here is a command with two nvarguscamerasrc for reference:
Using `nvcompositor` with `nvarguscamerasrc` leads to segfault in `nvcompositor` - #5 by DaneLLL