The documentation for Xdp.Portal::session-state-changed has the third argument of the callback function as a pointer, whereas it seems it should be a value:
void
session_state_changed (
XdpPortal* self,
gboolean screensaver_active,
XdpLoginSessionState* session_state,
gpointer user_data
)
i.e. I think XdpLoginSessionStage* session_state should be XdpLoginSessionStage session_state there. I couldn't work out how this comes about in the documentation generation process to submit a PR though, sorry.