“A man of genius makes no mistakes. His errors are volitional and are the portals of discovery.”
James Joyce wrote this in Ulysses. It appears in Scylla and Charybdis.
Where it appears
John Eglinton looked in the tangled glowworm of his lamp. ―The world believes that Shakespeare made a mistake, he said, and got out of it as quickly and as best he could. ―Bosh! Stephen said rudely. A man of genius makes no mistakes. His errors are volitional and are the portals of discovery. Portals of discovery opened to let in the quaker librarian, softcreakfooted, bald, eared and assiduous. ―A shrew, John Eglinton said shrewdly, is not a useful portal of discovery, one should imagine. What useful discovery did Socrates learn from Xanthippe?
From the public-domain edition, read it free.