Eduard

I tried running running your command from my LInux server

gpg --homedir /hs-connect/gpg --local-user 77720646  --sign --armor --output test.txt.bak --detach-sig test.txt gpg

the following was returned

gpg: can't connect to the agent: IPC connect call failed
gpg: problem with the agent: No agent running
gpg: skipped "62D20646": Operation cancelled
gpg: signing failed: Operation cancelled