I tried and escaping (to pass the $$ to the subshell) does not work as the subshell inherits the $$ value from the parent bash. The solution to this is to use $BASHPID.
(echo $$; echo $BASHPID)
prints the PID from the parent shell and from the subshell.