Current workaround are:
${FREE_PORT}
PORT=$(for p in $(shuf -i 30000-40000 -n 10); do (echo > /dev/tcp/127.0.0.1/$p) >/dev/null 2>&1 || { echo $p; break; }; done)
This command should check whether the selected PORT is actually FREE or not. If its not, it should iterate over.