I face the same problem. And I think I found out how to fix it. For the problem on my Samsung Galaxy A8, at least.
First type *#0011# on the Phone.
When you type the 2nd # the screen will change to ServiceMode.
Click More, and click WiFI.
Click the Ping Test button. The result should Pass.
And...