It's like GIMP still using GTK 2, it has no idea of Wayland at all so there's not much Wayland can do beyond run it an an XWayland island. Unfortunately there is no easy universal fix to that kind of gap beyond updating apps.
Edit: a sibling comment linked to the project I was remembering - xwaylandbridge
Oh I remember now, I was using GIMP and I couldn't figure out why the color picker was not working, I think that I understand now what was the reason.
Better hope the compositor of the week you're using that hasn't yet been abandoned is based on wlroots so you have some chance of it working.
https://invent.kde.org/system/xwaylandvideobridge
I don't think there is any solution for PyAutoGUI at the moment. Likely would require a lot of changes to their code.