As discussed with @andy and now @Mattijs, using return from main() circumvents the exit-code.
return
main()
Traced to the use of Pstream::exit() from the ParRunControl.
Will fix by adding in a separate Pstream::shutdown method.