Can you please confirm that the mongod node is started correctly after the first command, before you try to initiate the RS?
This was the goal of the first test (start without --replSet): making sure the node is starting correctly.

Can you connect to it and run the rs.initiate() command manually?
If yes, then this means that the node didn’t have enough time to set up and start properly and can’t accept write operations just yet. Maybe Github CI needs 2 minutes to start a node?
If you have access to the mongod logs, please share them.