The most likely explanation is that gnome-screensaver-command, when run in the context udev provides, has no idea whose screensaver on which display it is supposed to command - it is not running under your user account, and it does not have the environment variables that are propagated throughout your X user session.
An approach that can likely be made to work:
- run gnome-screensaver-command under a su to your user
- make sure that the DISPLAY environment variable is set to the same value it has in a terminal within your X session
- make sure that connection authority to your X session is established - this will need some fiddling with xauth and/or xhost, details very dependent on your exact setup
To explain the problem in more detail: X11, which gnome uses as its infrastructure, allows for scenarios like "multiple independent sessions, which might be all have different user accounts logged in, switchable via function keys or wired to different monitors and mice/keyboards" ("Multiseat") and "the actual session is running on a different machine than the one the monitor and HID devices are attached to" ("XDMCP" is the keyword here). "One session, one user" is actually just one possible use case, and the only one in which a command interfering with anything in such a session without being part of it could know how to react correctly - but there are no special provisions built in for that case.