Ooh, playing the game on Linux. I was not able to get it running on Nobara without the issue you mentioned BUT. After some research I do have suggestions.
You can update mkxp-z if you haven't done that yet.
You can try another RGSS compatible runner (Maybe a non-Kawariki-patches build)
Alternatively, you could edit the file.
In ".../Kawariki-patches/libs/Win32API.rb" Around where it does const_defined? (your trace says line ~372), change it to use an uppercase safe constant name.
Example:
# func is something like "keybd_event"
"const_name = func.to_s.upcase" # => "KEYBD_EVENT"
Replace checks like
"const_defined?(func)"
with
"const_defined?(const_name)"
and any const_set(func, ...) with const_set(const_name, ...)
IF that doesn't work. Uh, this is going to be ridiculous. If you install the RPG maker XP engine, and you run that through your emulator and then load the RXproj program that's in the game files and play the game within the engine. It should work. It's a pretty crazy solution to that problem but that's what i've come up with.
Good luck!