Hello,
I’m experiencing the exact same problem. The keymapping correctly works on a [removed] VM (ubuntu), but not on a remote Ubuntu accessed via NoMachine.
I’m using NoMachine 7.9.2 on macOS 12.3.1 on Apple M1 Pro. I also have Karabiner installed, but this does not seem to have an influence.