Is this issue exclusive to Java + xwayland for you or does it also happen with other non-Java applications running through xwayland? I’ve seen “juddering” in Discord running through xwayland as if the frames are being displayed out of order, and this issue is most likely the culprit.
NVIDIA says “Xwayland does not provide a suitable mechanism for our driver to synchronize application rendering with presentation, which can cause visual corruption in some circumstances” on this topic they posted about NVIDIA + Wayland.