This question is more complicated than it appears, so much so that even Oscar Wilde changed his mind about it.
After The Picture of Dorian Gray first appeared in the July 1890 edition of Lippincott’s Magazine, it met with extensive criticism from reviewers who condemned it as immoral. Wilde replied to these reviews by saying that he cared only about the aesthetic value of his work and was quite uninterested in the moral messages others might find in it. By the time he published Dorian Gray as a book the following year, he had added a preface containing the following aphorism:
There is no such thing as a moral or an immoral book. Books are well written, or badly written. That is all.
One should therefore be careful about trying to find any moral epiphanies in Dorian Gray. So far as Dorian does make a discovery about his and Lord Henry’s error, however, it is not about the unimportance of beauty (which would run counter to Wilde’s aesthetic philosophy) but about the place of beauty in art and life. At the end of chapter 11, Wilde writes:
Dorian Gray had been poisoned by a book. There were moments when he looked on evil simply as a mode through which he could realize his conception of the beautiful.
Close to the end of the book, in chapter 19, Dorian accuses Lord Henry of administering this poison, which is in line with his poisonous philosophy:
Yet you poisoned me with a book once. I should not forgive that. Harry, promise me that you will never lend that book to any one. It does harm.
At this point, Dorian has realized that Lord Henry is wrong and has steered him in the wrong direction. The book to which he refers is about the passive contemplation and fetishization of beauty by an aristocratic dilettante (it is based on a novel by Joris-Karl Huysmans, generally called Against the Grain in English).
Beauty, however, is properly the province of art: actively created by the artist and purified of evil by its dissociation from life. Dorian has shown his contempt for art by his willingness to trade Basil’s painting (and ultimately Basil’s life) for his own shallow, sensual existence as an ostensibly young man. Dorian, however, unlike Basil and unlike Oscar Wilde, never created anything beautiful which might have given meaning to his life.