That is in 99% just because you timeout from the server which will pop you the "Lost connection to server" message.
This is just client side and the server will take a bit longer to realize that you got disconnected.
So for everyone else you are still shown on the server and when you connect at that point, it will give you the "Profile name used by another person" as you are already on the server.
If you wait a bit longer or just keep doing the double connect thing there is nothing to worry about.
Overall i would say either your connection is unstable. (You can run tests at http://www.speedtest.net/ and http://www.pingtest.net/ if you like)
Or you are using a bad WLAN connection in which case using a cable connection to your router would most likely fix the problem.
Or the routing between you and the server you are playing on is bad.
To test that you can just try joining different servers.
Try the ones with a good ping first, the Official servers are only hosted in two locations so you might wanna try clan servers and different locations like AUS/CN/EU/JP/NA.
Just to test if it works more stable there.