Login screen freezes after the screen wakes up

Whenever I wake my computer after the screen turned off, the screen is frozen on the login panel for about 30 seconds before it flickers black, at which point it will wake up again and let me type my password to log in. Sometimes the panel will display “timed out” before the screen flickers to black.

I am running Ubuntu Budgie 20.04LTS. I have an AMD RX570 graphics card and dual monitors.