Changing keyboard layout not always working

I have a few hotkeys to change the keyboard layout to different languages like Korean, Japanese, Chinese and so on.

It often happens that the layout in the status bar is changed, the actual input but still the same as before. In this case I have to tab into a different app, or invoke spotlight / Alfred once before I can write in the new layout.
This happens randomly, sometimes it works fine, sometimes it doesn’t.

I read somewhere that this is a known problem in OSX. Is there a way with KM to force the layout and make sure it actually works?

Finally found the post I mentioned!!msg/osx-karabiner/w4HF8OGBjR4/v1cbfWf33h0J

Translating this to KM, it would look something like this:

alt-space is the shortcut for 'switch to previous input source'

So far I didn't need a timeout in between actions to get this working but might add one if it's needed