A recursive solution, using defaultdict to build a list of all dictionary values with the same key. I've added a few extra values to your dictionary for demonstration purposes.
>>> mydict = {'KEY': {'KEY': {'KEY': {'KEY': ['mylist'], 'name': 'foo'}, 'name': 'bar'}}}
>>> def flatten_dict(d, results=defaultdict(list)):
... for k, v in d.items():
... if isinstance(v, dict):
... flatten_dict(v, results)
... else:
... results[k].append(v)
... return dict(results)
...
>>> flatten_dict(mydict)
{'KEY': [['mylist']], 'name': ['foo', 'bar']}
>>>
An additional exercise would be to add a levels argument to flatten_dict to possibly restrict the number of levels it recurses.
Now, if you're just looking for the most deeply nested dictionary, we can use a different recursive function to iterate over the dictionary mydict and map a depth number to each nested dictionary. Then we just have to iterate over that list and find the dictionary or dictionaries with the biggest number.
An intermediate implementation of this idea, showing the list containing each dictionary and its depth.
>>> def deepest_dict(d, result=[], depth=0):
... result.append((depth, d))
... for k, v in d.items():
... if isinstance(v, dict):
... deepest_dict(v, result, depth+1)
... return result
...
>>> deepest_dict(mydict)
[(0, {'KEY': {'KEY': {'KEY': {'KEY': ['mylist'], 'name': 'foo'}, 'name': 'bar'}}}), (1, {'KEY': {'KEY': {'KEY': ['mylist'], 'name': 'foo'}, 'name': 'bar'}}), (2, {'KEY': {'KEY': ['mylist'], 'name': 'foo'}, 'name': 'bar'}), (3, {'KEY': ['mylist'], 'name': 'foo'})]
>>>
And the complete implementation, just filtering out what we want from that.
>>> def deepest_dict(d, result=[], depth=0):
... result.append((depth, d))
... for k, v in d.items():
... if isinstance(v, dict):
... deepest_dict(v, result, depth+1)
... max_depth = max(depth for depth, _ in result)
... return [elem for depth, elem in result if depth == max_depth]
...
>>>
>>> deepest_dict(mydict)
[{'KEY': ['mylist'], 'name': 'foo'}]
>>>