I have had a look at the database and compared it to my Glo and Touch plus backups of their databases. I think I know what.
Each book on the device has details in the database. This is a table called "content". One piece of information is a userid who "owns" each book.
There is another table called "user". This has details of the Kobo users for the device. In all the device databases I have seen, there is two users: the actual user logged in and another called "firstname.lastname@example.org".
As to the owner, there are some special userids. All sideloaded epubs and PDFs are owned by "adobe_user" and CBZ by "cbz_user". All the kepubs that you buy and download are owned by your Kobo user. And the five books in question are owned by the "email@example.com" user.
I think the last bit explains why the books don't appear in the library list. The library must be only showing books owned by you or the special userids. It isn't showing books from the last user above.
I suppose there is a bug somewhere. Whether it is that the books aren't shown in the library or are still in the database or have the wrong owner, I don't know.
And I suppose there is a bug in the driver. As the device doesn't show these books, maybe the driver shouldn't. But, I don't think it harms to have them there, so unless I get a lot of complaint, I won't change it.
@LMF: Thanks for sending the files. It is very useful to me to be able to poke around these database to see what is going on.