I have an Filco Japanese keyboard and the default settings on macOS even when the keyboard is set to Japanese (QWERTY JIS) gets the 英数 (alphanumeric) key, and かな (kana) key wrong (and they are supported on the built in laptop keyboard).
Word of warning: hidutil keeps the caps lock delay, so you’ll miss short presses. This drove me mad until I figured it out but by then Karabiner had thankfully been updated for the new OS.