Please check the possible reason and trouble shooting steps below to solve your issue:
1. Wi-Fi signal is too weak to establish the connection, please make sure the Wi-Fi signal is good enough when trying to connect;
2. Connection restrictions have been set on wireless router (such as MAC/IP filtering), please change the connection restriction of the router;
3. Phone firmware is faulty, please download the firmware from official website and update the phone.