Haydn’s later masses are longer and built more like symphonies. This is almost his last one, composed in 1801. It is called Creationmass because of a link with his better known choral work Die Schöpfung. In the Gloria of this mass, the text Qui tollis peccata mundi is sung on a cheerful melody that is a literal citation of the last duet of that bigger work. The wiki page explains this as a musical joke, but I’m not so sure. The Creation was hugely popular, and Haydn might just have been lazy here.
Empress Maria Theresa of Austria, that collected Haydn’s works, couldn’t appreciate it in any case. She forced Haydn to change it and he did. A different melody with the same tempo was the result in that version.