Rules defined under X11 do not work under Wayland due to different Window Class Names.
Unfortunately we are sent different information. There's nothing magic we can do.
Hi David! arn't programmers a kind of magician? Kwin then should iterate each rule at login time and re-fetch the information if needed depending on wheter X11 or Wayland is used. So a separate field for Wayland could be required in the kwin rule config. It would be fatal to leave the manual job up to the user. Imagine someone using X11 on an notebook and Wayland on desktop, but wants to share Window Rules between both devices.
Maybe it could be stored in the file whether it applies for wayland or x11. Or store two different files. Afaik other things already do that. For example display settings (orientation, position, scaling) are seperate on wayland and x11.
As noted, kwin is sent different information on x11 and wayland.