This bug is still present in bookworm. Attached updated patch.
diff -urN bash-5.2.15.orig/execute_cmd.c bash-5.2.15/execute_cmd.c --- bash-5.2.15.orig/execute_cmd.c 2022-12-13 17:09:02.000000000 +0000 +++ bash-5.2.15/execute_cmd.c 2022-12-13 17:09:02.000000000 +0000 @@ -5633,7 +5633,12 @@ /* If we're optimizing out the fork (implicit `exec'), decrement the shell level like `exec' would do. Don't do this if we are already in a pipeline environment, assuming it's already been done. */ - if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE && (subshell_environment & SUBSHELL_PIPE) == 0) + if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE && + (subshell_environment & SUBSHELL_ASYNC) == 0 && + (subshell_environment & SUBSHELL_PAREN) == 0 && + (subshell_environment & SUBSHELL_COMSUB) == 0 && + (subshell_environment & SUBSHELL_PIPE) == 0 && + (subshell_environment & SUBSHELL_COPROC) == 0) adjust_shell_level (-1); maybe_make_export_env ();