The problem in Atlassian Bamboo was solved by un-checking the default setting Use shallow clones
with description Fetches the shallowest commit history possible. Do not use if your build depends on full repository history
. This checkbox is located under Plan Configuration -> Repositories tab -> Git -> Advanced options
After this all the releases work fine.