I was having a similar issue on arch. I am very new to this however i found that if i stopped ufw (systemctl stop ufw) then tried to ssh into the pc and then start ufw again it works even after i close the connection.
I assume this has something to do with the ssh keys