This can happen if you don't fully commit and push your local changes to the submodules.
I got this error while cloning one of our repos with a submodule, while the original local repo was working fine. The problem was because I forgot the push the submodule changes.
So, make sure to commit and push all your submodule changes.