BGWH_STOPPED does not mean that the background process could not have been started, but it means it already exited - see the relevant documentation part: https://www.postgresql.org/docs/current/bgworker.html, there is no indication that error should be raised for such a return value:
... and BGWH_STOPPED indicates that it has been started but is no longer running
In our environment, pg_background_launch unpredictably and very rarely failed when BGWH_STOPPED branch was matched ("could not start background process" was reported in the log and it is the only place in the code with this message), but the process results were present and OK.
BGWH_STOPPED does not mean that the background process could not have been started, but it means it already exited - see the relevant documentation part: https://www.postgresql.org/docs/current/bgworker.html, there is no indication that error should be raised for such a return value:
In our environment, pg_background_launch unpredictably and very rarely failed when BGWH_STOPPED branch was matched ("could not start background process" was reported in the log and it is the only place in the code with this message), but the process results were present and OK.