Hi Herman,
This error occures, as the message says, when the module runs into a key that it didn't expect in the first place. The module processes each key several times, when retrieving it from the foreign database, when evaluating the data internally, when retrieving it from the mendix database and when comparing the mx data objects with the cached records. During all these steps the module will validate if the keys are still consistent. If they keys are different from what the module expects you'll receive the error message "found an object with an unexpected key"
This issue usually occurs when working with SQL server, there is an option in the synchronisation to search case sensitive. However MS SQL server does not support case sensitivity. So when you use a SQL server database (foreign or Mendix db) you can't use the option 'Search case sensitive'. So please make sure this option is never checked.