I can not quite fully understand your problem as I do not have much experience with Slurm and on my PBS/TORQUE cluster I do not have any problems at all with interactive connections. Thus I will mention two topics that may potentially be to your interest and you may want to investigate them further:
a) Connect to External REPL feature of VS Code Julia extension, as the name suggests, provides you with the option to connect to external Julia REPL session (Vscode 'send to active terminal' for persistence and access to scheduler-controlled HPC nodes? - #2 by pfitzseb)
and
b) Quick Cloudflared Tunnels that give you the ability to ssh to any machine without public ip (Quick Tunnels ยท Cloudflare Zero Trust docs)
Hope it may be of any help.