I am having this issue for quite some years as well. It is not nvidia related (as some people state) as I use Intel builtin graphics. I've already had this issue on Ubuntu 18.04. Usually my notebook is docked via USB-C to an external monitor and Ethernet-NIC, wifi stays on. My gdm3 login screen locks now and then when I undock my notebook and close the lid (or other way round). After opening the lid I neither can type in a password nor does fingerprint unlocking work.
I suspect network share automounter. Prior 20.04 I used autofs and these freezes happend very often. I changed the automount-scripts to detect my file server and things got better. With 20.04 I am using systemd to automount and things got even better. But still from time to time the login window just freezes. When I am still at home connected to my home wifi sometimes the login screen unfreezes after a couple of minutes - it looks like it needs some time for a timeout to hit.
If the freeze doesn't go away I switch to a terminal console and issue
export DISPLAY=:0.0
killall -3 gnome-shell
But very often that doesn't help anymore so I need to power down the notebook.
I've filed bug reports some years ago without any progress.
Launchpad
Gnome upstream