Running this command after cloning (and receiving the error) solved my problem:
git submodule update --force --recursive --init --remote
Of course this is not a good solution. It is better to find and solve the underlying problem, but if anyone is in hurry, this was worked for me.