Yep, that's EXACTLY how it is supposed to work. Welcome to the wonderful world of DRM
As I just commented in another thread, though I am not a fan of DRM when it gets in the way of something that you need to do with a book you have purchased, I think it's reasonable to play by the rules with library books.
If you have a book that is so badly formatted that you feel the need to strip the DRM so you can change the formatting, then you can use one of Alf's DRM stripping scripts or some of the unauthorized third party Calibre plugin's that you can find by Googling around on the web, but please don't ask for specifics here.
The Calibre author has made it very clear that he doesn't want his program associated in any way with programs that remove DRM.