Hmm, it looks to me like you are seeking to do something that the designers of pkexec have specifically set out to ensure you cannot do -
... pkexec will not allow you to run X11 applications
as another user since the $DISPLAY and $XAUTHORITY environment
variables are not set.
My guess is you could find a specific way around that (*) but it would not be very reliable and may not work on a DE other than the one you tested it on for example. Because you are relying on libnotify and trying to fool it, any change, internally, to libnotify would break what you are doing.
(*) - I'd start by leaving a semaphore file somewhere containing DISPLAY, reading that when your app starts up and trying to poke it into the env. But, honestly, its a bad way to do things.
Actually, what I would consider doing is having a 'server' running in userspace that the root app can communicate with, then the userspace app is in charge of triggering the notification, and, perhaps, do any other user interaction necessary.
Or, do it the official way, dbus. Thats what the Gnome devs would tell you do. They like lots and lots of code....
Davo