You haven't done anything "wrong". There is just a difference between the metadata stored internally in the book (that you see in the ebook viewer), versus that stored in the calibre database (that you see with the calibre library UI).
The metadata inside the book file is only updated if you:
(1) Do a conversion (such as a conversion back to itself like ePub -> ePub)
(2) Save to disk/send to device (*)
(3) Use the "Modify ePub" plugin (*)
(*) Covers in a book are only updated in situations 2 & 3 above if calibre is able to "identify" the cover image that exists. It doesn't work for all formats, nor will it work for all books. The only cast-iron guaranteed way to force covers into your books is to do a conversion, or manually edit the book using Tweak ePub/Sigil/other eBook format editor...