My own headcanon in regards to replicators is that they don't store and retrieve a transporter clone of a given item, but rather they use a procedural generation system to generate patterns on the spot. Picture how a
fractal terrain generator program works, and imagine a similar system being used to generate a "steak" pattern from the macro structure to the molecular structure.
A replicator steak would be made of the same molecules as a real steak, but if one were to look at it under a microscope, it wouldn't be made of actual cells and the like. It would be an abstract-looking lattice of proteins, sugars, amino acids, etc. engineered at multiple scales to provide the same mouth feel and taste profile as a real steak. Nutritionally and sensually the same, but only just structurally similar enough to fool human(oid) senses.
The computer wouldn't have to store full transporter patterns in memory, just tiny files containing a handful of algorithms and seed numbers, along with maybe any complex molecules that aren't in the replicator's standard library.
This would be the way pretty much every replicator pattern would work. Food items designed to replicate natural foods would be made of complexly layered fractal algorithms, but would still be extremely small as computer files go. Stuff like a glass vase, metal structural beam, teddy bear, or phaser rifle would basically be like a CAD file with instructions to bucket fill various internal volumes with specific materials. If you were to look at, say, the frame of a replicated phaser rifle under a microscope, you'd see a molecular structure that was an unnaturally perfect and uniform example of the material it was made of.
I figure that non-replicatable materials are materials that have a microscopic structure which is very difficult to reverse engineer a procedural algorithm for, and/or which cannot be reduced in complexity without destroying the properties that make it useful (i.e. you couldn't replicate them from a procedural dataset any more than you could a live animal).
Replicating transplant organs (e.g. Worf's spine) is difficult because full DNA extrapolation would require a lot more processing power, and would require a lot of research to insure your extrapolation method reliably produced useful tissue and organs instead of cancer cultures or DOA Brundlesteaks.
I imagine this is also related to why transporter patterns can't just be used will-nilly to cure diseases or make people immortal. I imagine that the actual raw transporter pattern is volatile quantum-level data, and is destroyed by the process of re-materializing someone/something: it only exists within the beam, not in physical memory. What's actually stored and used to restore someone is highly compressed overview data of various aspects of a pattern. This stuff is only recorded and kept for diagnostic purposes, and is an EXTREMELY selective, generalized, and lossy view of the raw pattern. When the transporter is used to "restore" someone like this in the show, they're basically hacking it to use this old diagnostic data as replicator-style procedural data to supplant the equivalent raw pattern data within the beam. This is ridiculously dangerous, as this diagnostic data does not represent the same granular complexity as raw pattern data. The risk of turning the subject into a cancer bomb or a puddle of meat soft-serve is super-high. But unlike with the replicated organ thing, each pattern and data-substitution is it's own unique data arrangement, so it's impossible to develop a system to do it reliably. It's a thing you can
technically do, but it's always going to be a crap shoot as to whether it won't just straight up kill you horribly like that science officer in TMP, so it's only a viable option when facing certain imminent death anyway.