I think it's fair to say that the many recent improvements to Calibre have made a closer connection between the configuration files and the library. They were always connected, but not so closely that it caused problems if you changed the library without changing the configuration files. Now, that's no longer true.
Ultimately, I think we're probably going to need some enhancements or bug fixes for people who want to swap libraries so that the config directory is also swapped.
Until then, we can change the configuration directory when we change the library with a batch file as discussed above.
Alternatively, we can change the user when we change the library. Since the config files are associated with a user, this may be easier for some.