Hw-1.2 giving error while running shell script

vagrant@database:~/shared$ ./setup-hw-1.2.sh
about to fork child process, waiting until server is ready for connections.
forked process: 32174
child process started successfully, parent exiting
about to fork child process, waiting until server is ready for connections.
forked process: 32220
child process started successfully, parent exiting
about to fork child process, waiting until server is ready for connections.
forked process: 32266
child process started successfully, parent exiting
MongoDB shell version v4.4.1
connecting to: mongodb://127.0.0.1:31120/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“78c49209-8379-41fe-8ee6-1c716b14a8b5”) }
MongoDB server version: 4.4.1
{
** “operationTime” : Timestamp(0, 0),**
** “ok” : 0,**
** “errmsg” : “No host described in new configuration with {version: 1, term: 0} for replica set TO_BE_SECURED maps to this node”,**
** “code” : 93,**
** “codeName” : “InvalidReplicaSetConfig”,**
** “$clusterTime” : {**
** “clusterTime” : Timestamp(0, 0),**
** “signature” : {**
** “hash” : BinData(0,“AAAAAAAAAAAAAAAAAAAAAAAAAAA=”),**
** “keyId” : NumberLong(0)**
** }**
** }**
}

Please review the script
May be sleep time is not sufficient
Before all 3 mongods came up it tried to initialize?
Remove the dirs and try to run the script again

tried manually also but it is not working

Script is failing in last line

initiate the set

mongo --port ${ports[0]} --eval “$initiateStr”

MongoDB shell version v4.4.1
connecting to: mongodb://127.0.0.1:31120/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“35801352-9f62-4f3f-b2ab-c99f3b160fb2”) }
MongoDB server version: 4.4.1
{
“operationTime” : Timestamp(0, 0),
“ok” : 0,
“errmsg” : “No host described in new configuration with {version: 1, term: 0} for replica set TO_BE_SECURED maps to this node”,
“code” : 93,
“codeName” : “InvalidReplicaSetConfig”,
“$clusterTime” : {
“clusterTime” : Timestamp(0, 0),
“signature” : {
“hash” : BinData(0,“AAAAAAAAAAAAAAAAAAAAAAAAAAA=”),
“keyId” : NumberLong(0)
}
}
}