You can disambiguate the parsing easily, to prevent hitting any such bug (though I can't reproduce it myself):
PS1='$(date +%s)'$'\n$ '
This $'\n'
syntax parses to a literal newline character, whereas '\n'
parses to a string containing a two-character \n
escape sequence.
For more info on how $''
differs from ''
(expanding backslash-escaped sequences) refer to the Bash Hackers Wiki.