With methods described below, when the phone disconnect from your wifi network, wifi will be immediately switched off. Also they don't require the Location Services to be on.
A. Xposed Edge
Open Xposed Edge, go to More triggers > Wifi Disconncted > Wifi > Turn off.
Open Macrodroid, click Add Macro.
Click the + on the right of Trigger. ...
Even I faced the same problem while using WiFi
U can try these
Restart the router
Restart the device
Going to settings and uninstall the updates of play store. As it is a system app, you can revert back to latest version after sometime
Hope it helps
Although you mentioned using Android 8 (You can get unofficial LineageOS on your HTC 10 device - at the expensive cost of failing SafetyNet verification - so you can choose android 9, 10 and even 11), the following applies on Android 9 and up:
Since Android 9, the setting for allowing or denying apps access to change wifi state is found under: Settings > ...
Android has an option to switch to cellular data if the wifi connection is low speed/signal. I suspect that the same mechanism triggers when the WiFi network does not have a default gateway defined, so all outgoing connections by default choose the source IP corresponding to the cellular interface.
To ensure you can talk to WiFi hosts where there is no ...
Large services like Facebook have own servers for web-site and mobile apps. Other services have one (API) server for both. Therefore there can be a relationship between the server of the website and the server used by the Android app but does not have to be.
The large services even have multiple servers distributed around the world that share the same DNS ...