Hi, when you run a shell block like this you usually want to prepend a nop command to ignore what the shell block produces, something like nop %sh{•••}, the default behavior of hooks and commands in their body definition is too evaluate the body as a sequence of kakoune commands, so the issue you have us most likely due to kakoune trying to interpret whatever your shell block expands to, also andreyorst has a plugin for managing keyboard layouts, GitHub - andreyorst/langmap.kak: Kakoune plugin to toggle between keyboard layouts in insert mode
This is a nice idea! I wish I had come up with this when switching to colemak. My solution is to change all the keybinds so they fit the new keyboard layout the best.