I too have the same issue. if we restart the phone it gets connected first time but if we disconnect it again and reconnect then the issue occurs again. Even i sent 2 error reports but still no update from Samsung.
I too have the issue with M51. I am able to connect to the same wifi using Apple devices but M51 has some issue.Didn't get any response from Samsung technical team as well.