Script example is bad
The try to clone yourself command is being executed locally (in the runner's context), not in the session established by ssh git@gitlab.com
.
The correct example of executing git clone
remotely is
ssh git@gitlab.com 'git clone git@gitlab.com:gitlab-examples/ssh-private-key.git'