There are many child prodigies in music - usually performers, but some composers as well. The most famous - Mozart - did not write any of his canonical works while a child, and indeed his early works are merely curiosities.
The fact is that compositional ability (like the related ability to do creative mathematics) apparently requires an adult brain, adult experience - or some-thing that takes a while to ripen.
But the exception is Mendelssohn; who wrote the above Overture to Midsummer Night's Dream shortly before he was eighteen, and this is recognised as first rate of its kind. To my ear, it is indeed the best thing Mendelssohn ever did.
The only other child-written music which is in the Western canon, and fairly often performed, are Rossini's String Sonatas done when he was just twelve years old!
These are merely light, entertaining trifles; and nothing like as good as the composer's later work; but they are very pleasant, and good enough that people still voluntarily listen-to and play them, two hundred years later!