Git Submodules failed to update

Jenkins setup: docker compose everything

I want to checkout private git repository that has private submodules in it, getting main repository works but command git submodule update --init --recursive gives me this error:

fatal: could not read Username for '[https://github.com](https://github.com/)': No such device or address
stage('Checkout submodules') {
            steps {
                //Checkout main repo
                git url: 'https://github.com/user/main-system.git',
                    branch: 'master',
                    credentialsId: 'github-wiktormalyska'
            }
        }
        //Initialise submodules
        stage('Initialise submodules') {
            steps {
                sh 'git submodule update --init --recursive'
            }
        }

Credential is in global in Jenkins