The cause seems to be that getWebWindow method on the OpenFin API Window sometimes returns undefined.
To test in the demo app, launch it with openfin -v 14.78.47.23 --launch --config ./public/app.dev.json instead of npm run launch. Go to useNotification then click launch.
Links:
Todo: Find a workaround (might be able to use the old v1 methods in fin.desktop in v2 of the OpenFin JS API).