Strange error message when tried to update a record from a Dynamics 365 F&O form

I have a form which is used for displaying and maintaining data from a Setup table. The table has a field named SetupMainAccount, which is related to the system table MainAccount through its field RecId. The field shows Account Number from the MainAccount table, but the client also wants to see the Account Number value in a separate column. So I’ve done it by adding MainAccount table to the form’s data sources, along with my main Setup table, and specified the relation between the two data sources. The MainAccount data source’s properties Allow Create, Delete and Edit are all set to No, because I don’t want any data from this table to be updated through this form. I have then added the MainAccount.Name field to the data grid, and everything looks fine initially. The problems begin when I change the Account number value from the dropdown in the grid, and try to save the record, the following message pops up:
Function DimensionValueRename::syncRenamedValue has been incorrectly called.
Does anybody know what causes this message. I have not called this function, but I have found that this function is called from the MainAccount table class’s update method. It probably means that the update of MainAccount table is attempted, but how I can prevent it?

You need to override write() and validateWrite() methods and avoid calling super() there. I put a slightly more details to the duplicate thread on another forum.