I ran into the same error message but likely a different scenario.
While the issues described above may differ, what I have learned may help further debugging.
The error occurred when I tried to create a calculated column cust_AccountName, which should show some data about an entity linked by the lookup-type column cust_Account.
I couldn't find anything wrong by looking at the UI or querying the table through WebAPI.
At this point, I decided to fetch the Attributes directly off the EntityDefinitions WebAPI:
https://<dynamicshost>/api/data/v9.2/EntityDefinitions(LogicalName='<logicaltablename>')/Attributes
Using the EntityDefinitions endpoint, I got a complete list of any internal and external attributes and their metadata. Indeed, a logical attribute with this name indeed existed and was an attribute of the lookup column I created.
[
...,
{
"@odata.type": "#Microsoft.Dynamics.CRM.StringAttributeMetadata",
"Format": "Text",
"AttributeOf": "cust_account",
"AttributeType": "String",
"EntityLogicalName": "cust_detail",
"IsCustomAttribute": true,
"LogicalName": "cust_accountname",
"SchemaName": "cust_AccountName",
"ExternalName": null,
"IsLogical": true,
...
},
...
}
So, for my issue, when one creates a lookup-type column, there is an internal Logical column <lookupcolumnname>name, which is automatically created.
More details about the EntityDefinitions Endpoint can be found on Microsoft Learn.