I have a rpi4 (Buster) setup as headless. I use putty to login. The only app I install is Plex Media Server. Every so often Putty says 'Connection to (local ip) closed' when I try to login to the server. The rpi seems to be running as I can still access my Plex Media server. I cannot ssh into the pi, however. Force unplugging the pi brings it back, but after a few days or so, the connection is closed again.
A little more info. I can login via putty, but once I start typing something, the putty screen closes immediately. If I try to ssh into the rpi4 from another machine. I get a message saying the connection closed.