EDIT : I have posted my tests table in
https://wiki.freepascal.org/Shutdown_and_Powerdown subject to revision

Davo,
Gnome is not running GTK2 anymore... THAT's the issue. Lazarus has probably a default that is increasingly unsupported. On some distro's GTK2 is an optional install.
You are confusing the "Gnome Shell", (what we call the Desktop or DE, Desktop Environment) AND the gtk libraries.
There are two clear, distinct issues (and some other, less distinct ones) -
- Any Gnome DE system will not trigger any of the graceful powerdown mechanisms in an LCL app, any widget set.
- A gtk2 LCL app will not triggering the OnQueryEndSession but does respond well to the redirecting SigTERM model (except, of course, with Gnome DE).
Given gtk2's status, we could and should consider the second one a documentation issue, as long as programmers know not to rely on OnQueryEndSession then it OK. Way past time they moved off it anyway.
But the first point is much more serious. A very quick search tells me that the most popular Linux DE is either Gnome or KDE. Gnome, being the default, is certainly the one new users are guided too. Hopefully, as they learn more about Linux, they migrate off it, good !
There is NO Workaround for the Gnome DE issue that I can find. I'm hoping someone can suggest one.
I haven't found a way yet to have Wayland listen to SigTERM. That is not a Lazarus fault persé.
That used to work on X.
Wrong ! Totally wrong ! gtk2 does not do a graceful power down on every completely Wayland-free system I have tested. There are unresolved eight year old forum postings about this issue. Further, Qt5/6 apps do a graceful powerdown on, eg Trixie KDE using wayland (indeed, switching to XOrg stops gtk3 and Qt6 ?? ).
These issues cannot be dismissed as wayland and cannot be dismissed as old technology !Davo