I recently had a problem connecting wirelessly to a router. I found the network with my router's SSID, clicked Connect and entered the encryption key. I got error messages repeatedly about the key not matching. The solution in my case was to set up the wireless connection manually when it did connect successfully. That may be worth a try.
Sony Xperia Z5 review: Hands-on with the phone which the Z3+ should have been