Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Heres what we have found: Constants.pm doesn't list all the custom objects that get_tables() show. For e.g., we have a custom object Daily_Usage__c which is not constants.pm but the query on that works fine. ContractAsset__c is not in their but the query on it doesn't work.
I will check on the part about Constants.pm. Regarding the API not having access to the object, I logged in as the API user in Salesforce and was able to view a record of that object. There is also no namespace that we have defined.