Post addition of several php composer packages git fetch unshallow fails

We added several PHP composer packages to our WordPress theme

updated the developer branch which triggered our pipeline. But now on each build things fail with this as error

git fetch --unshallow origin 9s
`+ git fetch --unshallow origin`
`fatal: shallow file has changed since we read it`

and this part is for building development server

...
develop:
  - step:
      name: Deploy Development
      deployment: test
      caches:
        - node
        - composer
      script:
        - echo "{\"http-basic\":{\"composer.deliciousbrains.com\":{\"username\":\"$DELICIOUS_BRAINS_USERNAME\",\"password\":\"$DELICIOUS_BRAINS_PASSWORD\"}}}"  > auth.json
        - composer install
        - git add wp-content/plugins -f
        - cd "wp-content/themes/theme-name"
        - npm install
        - npm run build
        - cd "/opt/atlassian/pipelines/agent/build"
        - mv .gitignore .gitignore-old
        - mv .gitignore-build .gitignore
        - git status
        - git add .
        - git commit -m "deployment"
        - git remote -v
        - git fetch --unshallow origin
        - git push -f $GIT_REPO develop
        - echo "Develop check"
...

How could things change on build causing unshallow fetch to fail? Why is this happening now and how can we solve this issue?