The closest to an attribution that I could find is by Matt Calhoun on Math SE, who claims "it was personally told to me" by "my mechanics professor (G. Horton) [who] took lectures from Pauli..." G. Horton is presumably George Horton who held a physics post-doc in Zurich in 1949-51. Pauli stayed in Zurich from 1946 until his death in 1958, so they did intersect. Horton moved to Rutgers in 1960 where he taught until 2009. He was popular enough for students to dedicate a memorial website to him. The anecdote is most often told about Pauli, but the story does show many signs of being made up, no first hand source, lack of detail, revolving names, etc.
It is also reminiscent of another, older story, with a somewhat better credentials but the opposite ending. Reid reports it in her book on Hilbert (p.93) (she also gives no direct attribution but implies that it was reported by Göttingen students whom she interviewed for the book):
""This theorem has not yet been proved, but that is because only mathematicians of the third rank have occupied themselves with it," Minkowski announced to the class in a rare burst of arrogance. "I believe I can prove it." He began to work out his demonstration on the spot. By the end of the hour he had not finished. The project was carried over to the next meeting of the class. Several weeks passed this way. Finally, one rainy morning, Minkowski entered the class followed by a crash of thunder. At the rostrum he turned towards the class with a serious expression on his gentle round face. "Heaven is angered by my arrogance," he announced. "My proof of the Four Color Theorem is also defective. He then took up the lecture on topology at the point where he had dropped it several weeks before."
Even assuming that this does have some basis in reality the "several weeks" and the melodramatic effects are most certainly embellishments.