https://www.classicfm.com/composers/mozart/guides/mozart-allegri-miserere/
This is a good summary of the general story, but it's hard to find supporting evidence.
Is there evidence of Allegri's Miserere entering the public sphere from a source other than Mozart?
There are indeed doubts that Mozart had transcribed the Miserere completely by ear just by hearing it twice.
On one hand, there is evidence to demonstrate that Mozart had a strong musical memory. In Sloboda’s “The Musical Mind”, there is ample evidence to demonstrate that Mozart wrote music by writing down works that he had already been thought up of, which requires strong musical memory to retain both the melody and harmony in one’s mind. Further, as Solomon recounted in his book Mozart: A Life, where there are multi-instrumental works that Mozart could not complete due to the exigencies of time, Mozart would write out the part for the other players to play, and play his own part from memory. Further, anecdotal evidence suggests that Mozart had perfect pitch and excellent relative pitch, and it is not difficult to imagine that Mozart could have the capacity of remembering the harmonies in the Miserere.
At the same time, just because Mozart could possibly have transcribed the Miserere by ear does not mean that he necessarily did do so. Indeed, as perhaps hinted at by Maynard Solomon in his book Mozart: A Life, it is possible that Mozart may have seen a copy of the Miserere prior to transcribing it. There are at least three authorised copies of the work distributed prior to the year Mozart transcribed it, and one of the recipients was Giovanni Battista Martini (see Graham O’Reilly’s 'Allegri's Miserere' in the Sistine Chapel), who happened to meet Mozart in in Bologna in March 1770. This was right before Mozart visited Rome in Easter 1770 and allegedly transcribed the Miserere by ear. Battista also kept in close contact with the junior Mozart and his father, and it cannot be ruled out that Mozart had either seen fragments of the score, or have heard it being played for analysis by Battista. It is further suggested by Chrissocoidis that Mozart could have seen a fragment of the score in 1760s in London. Further, to answer part of the question, some musicians of that era (such as Blainville) had transcribed portions of the Miserere (for Blainville, in the Histoire). It could therefore be that the melody and harmonies of the Miserere was not foreign to him.
Ultimately however, as suggested by Graham O’Reilly, the difficult part of the Miserere is not just the notes that were written on the score, but the vocal ornamentation used. In that era, vocal ornamentation was widely used and was not necessarily written down in the score. In other words, what you see on the score is not what you will necessarily hear. It is also thus proposed that while it is easy enough to transcribe the Miserere (as it was written) by ear as anyone could have done (and could have gone ahead to do so, perhaps at the pain of excommunication), what made Mozart special was that Mozart went ahead to transcribe the vocal ornamentation of the Miserere, and did so with relative accuracy.