There are three main ways to get problems with the calibre library.
1. Operator error, that is to access and do changes to the library directly instead of via the GUI. This includes overwriting the current library or database with a previous backup, instead of fully replacing the library from the backup. Even very minor changes to a filename means that calibre loses track of the book format.
2. Operating and filsystem differences. For instance Linux cares about the case of characters in filenames and paths, Windows doesn't. If you move a calibre library between two operating systems bad things can happen, typically exactly like you described it. Differences in case of the letters in the filename is another example of minor differences that makes calibre lose track of book formats.
3. Hardware and filsystem corruption. All harddrives fail if you use them long enough. Also it is not safe to store the calibre library on a networked drive.
You didn't provide enough information to decide which one is most likely, but perhaps 3 followed by 1?
Some of these problems can be fixed using the filesystem tools in your operating system, in combination with the calibre library maintenance tools. If that doesn't work, then you may have to restore the most recent backup of your valuable library and manually add all the books you added since then. Also redo any other changes.
http://manual.calibre-ebook.com/gui.html#library
All errors that are indicated by the calibre library maintenance tools should be fixed.