In TNG S6 Ep22, Crusher wants an autopsy to help determine whether someone was murdered, but the dead guy’s family has cultural objections. In the story she goes ahead anyway, jeopardising her career - and that’s not the point.
To me, it seems obvious that some simple combination of replicator and transporter should allow Crusher to make a copy of the corpse and autopsy that… or if you want to be awkward about it, quietly autopsy the original and offer the copy to the family for whatever ritual their culture follows.
Personally, I think the very idea that even early Trekkers couldn’t use their transporter buffers to keep back-up copies of every transported “passenger” risible, except for bandwidth or storage capacity but even that isn't the point.
Routinely buffering every transport might be unreasonable but here in S6 Ep22 it’s by no means routine… it’s next to being an emergency and if we could imagine such a replicator or transporter copy taking 10 or 100 times the normal resources, is anyone suggesting a whacking great starship couldn’t cope with that?