Now that helped, it was a rather interesting bug, triggered in very special circumstances:
https://github.com/kovidgoyal/calibr...d2ca1eaf37310a
Note that if you have any books in your library affected by this bug, you can fix it by simply running Library check and deleting any extra files that it reports. (Right click the calibre icon on the toolbar and select Library maintenance->Check library)