The most likely thing is that something happened to restart the device. When it tried to read the database to get whatever it needs, it couldn't. That triggered the setup process being called. It probably also cleared the .kobo and .kobo-images directory. The rest was it doing the setup.
As part of the setup, it should have downloaded the details of your purchased books and the file for five books. These are usually the five most recent books according to the "Recent" sorting. Then it should have imported all your sideloaded books. But, you interrupted that. Hence, the only imported books where the ones it had imported before you forced the restart. If you had connected to the computer, the import would have started again when you disconnected the device. But, it is possible that forcing the restart, would have damaged the database eventually putting you back in the original state.
What initially happened, I don't know. If the importing was going slow, it could be that there was already a problem with the database. Or the books you sideloaded were a bit bigger than usual or had some problems making the import slower than usual. There is a process that will restart the device if there is a hung process. That might be why it restarted. At this point, there is no real way to check.
|