If a command substitution inside a parameter expansion has a command followed by a newline, bash prints an error message (though the command is parsed and saved in the history list correctly):
bash --norc -in <<<$'${_+$(:\n)}\n!!' $ ${_+$(: bash: command substitution: line 3: unexpected EOF while looking for matching `)' > )} $ !! ${_+$(:; )} If the command substitution starts with a newline, no error is printed but the command is _not_ saved correctly to the history list (a semicolon is inserted at the start): bash --norc -in <<<$'${_+$(\n:)}\n!!' $ ${_+$( > :)} $ !! ${_+$(; :)}