The error you mentioned is a reporting error, so my guess is that you encountered that because you were using the
GetAccountHierarchy.cs example to get all accounts under an MCC and then tried to run a report for each of those accounts, but some of those accounts were MCC accounts. You can avoid the
ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH error by only submitting report requests for accounts where
ManagedCustomer.canManageClients is
false. Accounts where that value is
false are standard (non-MCC) AdWords accounts.
Regarding the dictionary error, if that's occurring at
line 94 then my guess is that the predicate you added to the ManagedCustomerService.get request was for
CanManageClients = false. With that predicate, the ManagedCustomerService.get will only return standard AdWords accounts in the
ManagedCustomerPage.entries[]. Therefore the
customerIdToCustomerNode dictionary in the example won't have entries for any of the manager (MCC) account IDs, so when the loop at line 92 tries to look up the managed customer for each link in
ManagedCustomerPage.links[], it fails. I'd remove that predicate and then use the approach I mentioned in the first paragraph.