Hi, and welcome to the community
When you factory reset, did you immediately install any backups? If you did, then try another factory reset, but this time, leave the device as stock. Don't install any backups or 3rd party apps / customisations. If you are still getting constant disconnecting, then log into your routers admin page and check which devices are connecting to the different WiFi bands. Ideally, you want to be connecting to the 5ghz band. If you have the 2.4Ghz band and you find that many devices are connecting to it inc your phone, then this could be your problem. The 2.4Ghz is not ideal for heavy traffic.