Ive had this exact problem for the last 3 days with two of my 6 hikvision cameras. They would reset to factory defaults at random times, but always within 2 minutes of each other. Roughly once a day.
Both are behind a firewall and part of a Synology camera system.
Disabling upnp, cloud...