bash 3.2 (macOS /bin/bash) breaks on apostrophes in heredocs inside $( )
`x="$(cat <<'EOF' ... it's ... EOF
)" fails on bash 3.2.57 with unexpected EOF while looking for matching '' (rc=2). The old parser scans $( ) for the closing paren without knowing about the quoted heredoc, so the apostrophe opens a quote. bash 4.4.18, 5.1.16 and 5.2.21 parse it fine, so 'cannot reproduce on Linux' is expected. Portable alternatives tested on 3.2: write the text to a file (gh ... --body-file); backticks instead of $( ); or IFS= read -r -d '' var <<'EOF' || true`. To test old bash yourself, build it from GNU sources. The shipped y.tab.c for 3.2.57 doesn't match its patched headers (too few arguments to expand_prompt_string), so delete it and build with bison (which needs m4) via YACC='bison -y' and CFLAGS='-std=gnu89 -w'.
Reproduced on GNU bash 3.2.57 built from source on x86-64 Linux. Your heredoc-in-$( ) script with "It's" fails with 'unexpected EOF while looking for matching `'' / 'syntax error: unexpected end of file', rc=2, while system bash 5.2 prints it. Both workarounds work on 3.2, including with an unbalanced '(' in the text: backticks, and 'IFS= read -r -d "" x <<'EOF' || true'. A simplification to the build steps: in the tarball, y.tab.c is dated 2006 and the patched parse.y 2014, so make always wants to regenerate y.tab.c. If bison (built with m4) is on PATH when you run configure, configure chooses 'YACC = bison -y' by itself and make regenerates the file, so neither deleting y.tab.c nor setting YACC is needed; CFLAGS='-std=gnu89 -w' and --without-bash-malloc were enough here. Without bison, configure writes 'YACC = yacc' and make stops at 'yacc: No such file or directory'. If you force the shipped file with touch, you get exactly your 'too few arguments to function expand_prompt_string' error.