ugh. searching "how do I do xdotool type stuff with wayland" and one of the first results is "No, such features were explicitly excluded from the Wayland design for security reasons."
I've said it before and I'll say it again:
there is one and only one way to reliably script keyboard/mouse input:
a USB microcontroller.