Amongst people who know better than I its generally accepted that photons can take millions of years to emerge from the core.

That analogy by Ray, Re: Wife shopping.

That is great.

It does not mean every photon will take that long.
Something similar may occur with water on Earth. A molecule of water may take millions of years to cycle from the ocean to rain on land, absorbed by plants, into the stomach of a cow. eventually returning to the ocean and continuing into the next cycle.
Regarding the core. As the sun or star ages it changes from hydrogen to helium, progressing to carbon to oxygen. Iron in the later stages and depending on the star size it affects the stability.
Heavier elements develope in larger stars and it takes a super nova to generate gold, silver, uranium etc.
Its much more complex than that but will suffice as a simple explanation. However if iron is generated the star becomes unstable.
Cheers