I think this can be improved. It seems this is most common with new users, who will care less about a possible ban - or even be unaware of it.
A possible solution is to differentiate between leaving the game and bad connection (which is possible to detect). If actually leaving game, eg. closing website or closing app, then the opponent should get a dialog box where he can claim draw/win. If bad connection (ie. loss of connection without detecting closing of app/site), then benefit of doubt should be given to leaving user.