Hi Karlis,
Because you are having this issue only in cloud, I think the constant value in cloud is different than your local host hence it is not working as expected. Please can you go to Environment > Details > Model Options tab and search for your constant and make sure the value is correct? https://docs.mendix.com/developerportal/deploy/environments-details#model-options
Constants values are not automatically updated if you just update them locally. Only in the first deployment they are defaulted to the values defined locally after that if you change constant value locally and commit then it will not be updated automatically in any Mendix cloud environment. You have to manually update the required constant values.
Hope this helps!