I digged a little deeper and ran some more tests. The following solution works as desired:
wrapper.sh:
#!/bin/bash
Command line to run the wrapper script:
nohup ./wrapper.sh
So the `-bg`option is actually not necessary to run the wrapper script in the desired way.
The problem with the stopped processes appears when starting the wrapper script as a background process like this:
nohup ./wrapper.sh &
In this case, both the wrapper script and the nextflow process are stopped and do not run, while being listed as stopped processes in the process table.
The only inconvenience with this solution is that when I launch without the ampersand, I cannot continue working on the command line but have to open a different terminal.