I don't think you can equate adult composing prowess with early apparent "giftedness" for several reasons. For one thing, even so-called child prodigies who compose - including Mozart - don't write music of real mature and enduring appeal at such a young age (for obvious reasons). That only comes much later, in Mozart's case for example from his late teens. Childhood "talent" for composing usually consists of understanding the rules and procedures for putting melodies and harmonies together in a way that makes sense to people, albeit in a derivative and superficial way. Of course that's no mean feat for a young child, but it's basically a process and a grammar that can be learnt - even when people learn a lot of it by osmosis, living in a musical community or household, rather than by analysing everything. It's like learning a language in that reaspect.
The fact that Mozart went on to compose pieces of staggering emotional depth that have endured to this day (which is the only thing really that differentiates him from all the minor composers of the time who just wrote music that "makes sense") only means that by the time he approached adulthood he had assimilated a huge amount of awareness of the power of various musical elements and of the musical grammar of his time. He may have been exceptionally motivated for whatever emotional reasons to do so, or the circumstances of his life may have simply added up to that happening where those of other lives don't. There's no evidence at all that he did so because of any genetic predisposition to do so.
Reports about so-called prodigies "composing at a young age" nowadays are even dodgier because there is little agreement about what even constitutes "good" composing, and certainly nothing like the cultural consensus of 18th century Vienna. The fact that a person of whatever age "can compose a piece" really means nothing, without actually hearing the piece - and even then, you're unlikely to get the same opinion about whether it even constitutes a half decent piece, let alone genius, from any two different people.
Of course not all people "of a similar upbringing" go on to do the same outstanding things in music or anything else. But that is meaningless because even with a superficially similar upbringing, the experiences of children in the early years of their life are all entirely unique. Even if you could devise an experiment where two children were given the exact same experiences externally measured (which of course you can't), that wouldn't do it because experience is an internal reality, not an external one. You could make two children practise the piano for two hours a day and that would be irrelevant because one of them might be at a stage of development where three hours would be appropriate, and the other only capable of one (but actually capable of ending up just as good a musician in the long run, as long as he isn't demoralised by being pushed too hard). Or one might be far better off on a different instrument than the piano, or whatever.
Assuming that the differences between five or eight year olds must be due to innate inherited factors is absurd, when you consider the absolutely staggering number of neural connections made during those years in response to experience, and the absolutely staggering number of differences in even similar sets of experience. Which is not of course to say that there CAN'T be innate differences, and we should of course accept them when there is evidence for them. But most people just use them as a default explanation, without evidence, for any situation where the end result is "a lot" or "very impressive", because they can't imagine how such a result would have been possible any other way. It's pretty much like believing there must be a God just because the world is a complex and amazing place.