TeXmacs crashes due to custom keyboard layout

In Macbook M1, many custom Alt+ shortcuts are overriden by the system (e.g. Alt+c) even if it’s redefined in my-init-texmacs.scm. So I use a custom keyboard layout from http://wordherd.com/keyboards. This works in the editor itself. However, the editor crashes if I input any non-number character in many dialogs, such as the Padding diaglog of tabular. The layout file is uploaded in the bug report https://savannah.gnu.org/bugs/index.php?63472.

In Mac Intel, the problem is Alt becomes ineffective completely.

It turns out the problem occurs if the layout is used in my custom input method: Sogou input method. If I use the layout as a standalone input method, then the problem is gone.