...
Screen resolution should be at least 1920x1080 and 24 or 32 bit colour. Don't enable desktop fractional scaling or anything like that. It may not cause any failures but is still recommended.
Wayland
java.awt.Robot in Wayland sessions may not always achieve the desired result using only the X11 API.
XDG Screencast/Remote Desktop portals can be used for screen capture/mouse or keyboard control. They require consent from the user for these actions.
For automated testing purposes, it makes sense to perform a one-time manual task that calls all required Robot methods to invoke this consent dialog and provide the maximum available permissions (select all displays, remember this selection, allow remote interaction).