This is probably a Wifi problem, this can be for various reasons.
1.) Wifi signal is unstable.
2.) Wifi signal is too weak.
3.) Using an access point with the same SSID and password that do not support the IEEE 802.11R standards.
Problem 1 can often be solved by restarting the router.
Problem 2 can be checked with an app Wifi analyzer with this the signal can be viewed and corrected to a better position.
Problem 3 can be checked as the access points are turned off, the Wifi signal is still good and the connection remains if the access points are a problem, a Mesh solution can then be used.
Please make sure that they support IEEE 802.11R standard.