3 last distinct values of a list taken from a list of dictionaries
Use a dict comprehension to keep track of the last index for each order_id_local and skip blank entries:

local_ids = {order['id']['order_id_local']:n for n,order in enumerate(data) if order['id']}


Then reverse sort the dictionary keys by their value and slice off the first 3:

sorted(local_ids.keys(), reverse=True, key=local_ids.get)[:3]


result:

['xxx_003', 'xxx_002', 'xxx_001']