Hello!
The default value of org-src-lang-modes contains ("bash" . sh), meaning
that for bash src blocks sh-mode gets used.
sh-mode supports many different languages (bash, zsh, dash, ...).
Often, when opening a file for which sh-mode gets activated, there is
enough information for sh-mode to determine the language that actually
is used in the file, e.g., by a shebang, or by the suffix of the
filename.
However, that usually does not work with Org src blocks. When sh-mode
has no clues, it in effect always uses the language determined by the
SHELL environment variable (at least on POSIX-conformant systems). If
that is not something like /bin/bash then sh-mode is not a bash mode.
E.g., with SHELL=/bin/zsh opening an edit buffer for
#+BEGIN_SRC bash
#+END_SRC
yields a buffer with the buffer-local variable sh-shell set to zsh
instead of bash, i.e., sh-shell is a zsh mode.
This can be fixed by defining something like
(defun org-babel-bash-mode ()
(sh-mode)
(sh-set-shell "bash"))
and having ("bash" . org-babel-bash) in the default value of
org-src-lang-mode.
Best wishes
Sebastian