I wanted to pull commit \"3a2ceef391af73994dfeb0d8ef57ed6a52ef4238\" from branch android. I used the command:
$ git fetch origin 3a2ceef391af73994dfeb0d8ef57ed6a
This can happen when you are pointing to submodule commit that has been removed through a history re-write or squash. The best you can do is:
parent-repo$ git fetch
parent-repo$ cd submodule-a
submodule-a$ git pull
submodule-a$ git checkout best-commit-according-to-team-and-your-branch
submodule-a$ cd ../
parent-repo$ git status
...
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: submodule-a (modified content)
...
git add submodule-a
git commit -m "updated submodule-a reference"
Once you are happy it is correct and your team agrees you can push it up and the error should go away.
According to this answer and the given source it looks like BitBucket does not allow you to fetch a commit id, only references.
I cannot say if you can configure this behavior, but I think you can:
git pull origin branchname
git checkout <commitid>