Hello Pavlo,
Check this, I found a similar issue on one of our systems and it was related with the Gateway's security options:
Making Security Settings for External Programs - Security Settings in SAP Gateway - SAP Library
As far as I remember there is some setting to be done on transaction SMGW --> External Security --> SecInfo that allows to execute remote programs by users. In case you installed a standalone Gateway on the database server there should be a SecInfo and RegInfo file where you can define the security options.
Regards.