I already have enabled “grab the keyboard”. Probably I should have mentioned that I’m on macOS Sonoma on both sides. So it is probably somehow related to the already reported issue with keyboard grabbing on Sonoma https://kb.nomachine.com/TR03V11102.