Hi,
The reason is that the heading and html sections are not rendered until you click a tab. This change was made to reduce the initial load time on larger forms with a lot of headings and html sections.
Define your variable in Custom JS like this:
var thetext = "hi Alex";
Change your heading textarea like this:
{{var:thetext}}
Then just change your variable like this:
thetext = "hi Bryan";
and it will automatically reflect in the heading.
Alexander