[500 error ]Unable to download secure files using securefiles API

For my Android application project i am sing secure files feature. Project-level Secure Files API | GitLab i have followed this link to download the files for my cicd pipeline but it always returns "500 internal error "

{“message”:“500 Internal Server Error”}

above is the content always getting written into the file which it’s created. Below i have added my sample script

  image: alpine
  stage: init 
    #- apt update && apt install -y curl
    - apk add curl jq
    - curl --request GET --header "PRIVATE-TOKEN: my token" https://../api/v4/projects/../download --output value.json
    - cat value.json

I’m having the same problem in a self-hosted Gitlab service running “GitLab Enterprise Edition v15.8.3-ee”. Downloads work from an external client, but not from within a CI pipeline with the same token.

I’m also facing the same problem. I’ve tested this from Gitlab and from terminal and the download succeeds occasionally but fails most of the time with Internal server error.