If I understand correctly, Wayland does provide better desktop security. At least two of the common issues are tied directly back to that.
Screen sharing apps, which need to access what one or more other apps are showing, and screen readers for the deaf, which need to access what text other apps are displaying.
Wayland intentionally recuses itself of these problems. That's understandable, as these problems aren't specifically in the realm of a display protocol. However, this has led to some significant problems.
Specifically, since there is a power and implementation void, and the Wayland crew haven't stepped in or endorsed any particular way to fill it, each compositor/desktop library is now implementing it's own means to achieve these ends. This leads to other problems.
You want to write software for X for some of these things, and regardless of the DE you're working in, there are more fundamental ways to address the information you need. But if you want to do so with Wayland, there's no "fundamental" layer to reach for, because it's handled by the DE compositor and toolkits.
So you need to do it the KDE way, or the Gnome way, or the wlroots way, etc etc - and what if you want it to work with all of them? Simple: just code it multiple times and deal with multiple different frameworks, each with their own learning curves, restrictions, and quirks.
..by which I mean, "/s, jk jk, not actually simple."
Really, my hope at this point is that maybe kde/plasma and gnome will standardize around wlroots (i.e., there is no hope).
So, failing that - maybe a single library for accessibility that does the work once (multiple times, but once), and is adopted and used by kde/gnome/wlroots, and a single library that does the same for display sharing.