You're doing:
bash << 'EOT'
some-command-that-reads-stdin
EOT
But some-command-that-reads-stdin's stdin will be that here document as well, as it is started by bash so inherits the same stdin.
You could do:
bash /dev/fd/3 3<< 'EOT'
some-command-that-reads-stdin
EOT
So stdin is left untouched, and bash gets the code from that here document on another fd.
Note: I can't save this edit because I just remove single quote marks from last EOF and it's not enough for saving: Reviewer, Please remove them yourself.