From my experience,, this behavior is mostly related to how the browser handles PWA notifications and service workers.
When the PWA is completely closed, the service worker handles the notification, so the click action works as expected.
When the PWA is already open, the browser keeps the active session and does not always trigger the notification flow. This is expected behavior.
For the background case, the notification appears because the service worker receives it, but clicking it only brings the PWA window to the foreground. The navigation URL/action needs to be handled separately.
What I usually do is:
Also verify that the URL you pass is accessible after login/session restore, otherwise the PWA will just open the app homepage.
This is more of a PWA/browser limitation than a Mendix issue. The behavior can also vary between Chrome, Edge, mobile browsers, etc.
Kindly mark this as the accepted answer if it helps.