Recursively patching the properties of an ORM model and related models
If we assume that either for loop can come before or after the other for loop.
Then you should check if anhaenge is not None.
As your except TypeError is to guard against that.
You can then return from the function after you log the error, remove the except TypeError, remove the duplicate for loop,
and finally, put the duplicate for loop after the if, as you wish to perform the loop here on either branch. EG:

try:
    anhaenge = d['anhaenge']
except KeyError:
    self.logger.debug('anhaenge unchanged')
else:
    if anhaenge is not None:
        try:
            anhang = anhaenge['anhang']:
        except KeyError:
            self.logger.debug('anhaenge.anhang unchanged')
            return
        else:
            for anhang_ in anhang:
                with suppress(EmptyDict):
                    for record in Anhang.from_dict(anhang_, immobilie=self):
                        yield record, PatchMode.CREATE
    for record in self.anhang:
        yield (record, PatchMode.DELETE)


But this is not possible if the duplicated for loop has to occur before the other for loop.

Either way, I honestly don't think you're input is right.
Your input is strange, None is normally used to say it's not there, and so dict.get('a', None) is a common occurrence.
However your code performs differently whether it's None or not there.
And so I'd say you should restructure the input so you can use say:

anhang = d.get('anhaenge', {}).get('anhang', None)
if anhang:
    for record in self.anhang:
        yield (record, PatchMode.DELETE)

    for anhang_ in anhang:
        with suppress(EmptyDict):
            for record in Anhang.from_dict(
                    anhang_, immobilie=self):
                yield (record, PatchMode.CREATE)
else:
    self.logger.debug('anhaenge or anhaenge.anhang is unchanged')




If you can't adapt either of the above, then I'd say your code is good for your situation.