On macOS, valid syscall numbers all have a high bit set, leaving the low range "invalid" to be caught by SIGSYS.
On a Mac running macOS 14 or later, the test passes. macOS 13 and earlier have a kernel bug which prevents SIGSYS from being delivered.
This patch was adapted from Apple's Game Porting Toolkit Wine patch, and from the 'ntdll-Syscall_Emulation' wine-staging patchset.