It usually happens when you call your custom api from postman and forget to add some required headers:
If Environment ...
The following PowerShell script can be made available as a Web API endpoint within Sitecore. Instructions on how to do this are documented in the script:
# Reconnect Sitecore Commerce catalog
# https://www.sergevandenoever.nl, https://www.linkedin.com/in/sergevandenoever/
# Execute the manual steps to correctly reconnect a catelog when a Sitecore XC ...