stderr is captured in either --run-script-before or --run-script-after but all that it does is include the output in Duplicati’s own logging mechanism.
stdout on the other hand is only captured in --run-script-before. It’s designed to let a backup script adjust parameters before the backup runs. Duplicati will parse stdout looking for strings that start with -- so it can adjust parameters.
You can see an example here:
stdout is never written to Duplicati’s logging mechanism that I can see.