How to fix keyboard layout bug in Sierra?
I found a possible solution to this problem, I am not sure if it will work for you.

Instead of using the "next input source" shortcut, I use now the "previous input source" shortcut, and of course I swapped the keyboard bindings.

Hopefully this will work for you too.