Very weird case, had it happen locally, tried what seemed like everything, restarted my computer and suddenly the issue was gone.
Don't even know how to debug this properly.
Don't even know at what point this gets caused. My most likely guess it has something to do with reloading the cog since when doing that /reload misc would throw [22] Invalid Argument or something along those lines.
Maybe it's best to connect/disconnect the cog from DB on load/unload? That way the connection will be severed and maybe the issue won't happen.