It’s a bit hard to debug the issue, since you’ve posted an image which does indeed seem to show that dataset_dict['annotations'][0]['id'] might be working.
Feel free to post an executable code snippet, which would reproduce the issue.