Famous composers mimicked other composers plenty, or parodied other composers, copied them or played homages. Mimicked, yes, famous composers definitely did mimic other composers.
Prokofiev Symphony No. 1 is one of the more famous. It mimics Mozart and Haydn (obvious choices!)
Stravinsky’s Octet is another.
There are plenty of other examples. Those are just two of the more obvious ones. Bach did it. Beethoven did it. Mozart did it.
I guess the subtle distinction here is that these great composers probably did it because they simply could do it as one deliberate choice among many. Lesser composers may be stuck mimicing a few styles because they lack the skill to go beyond them.
But if some unpublished work mimics a certain style, I would assume that it is an exercise to gain a better understanding of that style.
Fritz Kreisler faked some old composers'---e.g. Vivaldi's---work, claiming to have discovered some unpublished manuscripts, but later revealed that they were his own compositions all along.
It was mostly a prank on the music industry, but nonetheless, mimicry of style was involved, and was enough to fool many people for years.
Huh? Bach was the greatest recycler of all time. His keyboard suites were all styled after popular dances in Europe: the Allemande, the sarabande, courante and gigue. He just one upped them to a whole new level.
If you listen to Haydn's sonatas, do you feel the resemblance of Mozart's? Well, because Haydn taught both Mozart and Beethoven.