I have seen suggestions that some machines get monitor "hotplug" events when they go to sleep and that might cause them to immediately wake up again. If that was the cause then selecting:
Ubuntu on Wayland
from the login screen (bottom right corner just before you enter your password) might avoid the issue. Actually trying 'Ubuntu on Wayland' might avoid the issue even if the root cause is something different.
I have seen suggestions that some machines get monitor "hotplug" events when they go to sleep and that might cause them to immediately wake up again. If that was the cause then selecting:
Ubuntu on Wayland
from the login screen (bottom right corner just before you enter your password) might avoid the issue. Actually trying 'Ubuntu on Wayland' might avoid the issue even if the root cause is something different.