score:4
Long comment
Alchemy was a "living subject" in Islamic science and philosophy.
See at least Lawrence Principe, The Secrets of Alchemy (2013, The University of Chicago Press), Ch.2 Arabic al-Kimyia.
A central thinker was Jabir ibn Hayyan (Latin: Geber). Also al-Razi with the Book of Secrets and the refutation of al-Kindi's denial of the validity of alchemy.
Ibn Sina (Avicenna), in turn, in the Book of the Remedy denies the possibility of metallic transmutation.
Also al-Baghdadi was profoundly averse to alchemy.
I've found no reference to Ibn Rushd (Averroes) interest into alchemy.
Having said that, a possible conclusion may be the following: it is reasonable to assume that Victor Hugo had no detailed knowledge about Islamic science.
Thus, a "generic" knowledge about Arabic and Middle Ages interest into alchemy, as well as the common (in Hugo times) view about the "dark ages", may explain Hugo's story.
The attribution to Averroes is probably due to the fact that Averroes'name was (one of) the "best known".