I have experienced this issue a few times, but not always.
Since I use connection to my wifi at home for smart lock, disconnection is obvious as I get asked for a password then.
Running FPOSOS, I didn’t have this problem for 2 weeks. Just a couple of days ago it appeared, after putting in my pin I saw the wifi symbol reconnecting.
I don’t know why and when it disconnects, haven*t yet found a pattern. Though, while charging the phone does not disconnect wifi (that I realized).