I’m using the following but it is returning an ID that is not the media ID
{{ paragraph.field_document_file.entity.field_document.entity.id }}
"field_document_file" is an entity reference to "document" media. If I examine a media file in Views the actual ID is "39701" (for example) but the above twig outputs "104956" instead.
I cannot figure out where "104956" is coming from instead of "39701" (the actual media ID).
NOTE that the 2nd .entity. above is the media object so that’s why I was expected .entity.id to return the entity id.