Wrong person wins on tie.
Recently I was playing 4 player C&K and two of us had 12 points. It was the AI player's (with 12 points) turn, and he rolled a barbarian on the event die which gave me 13 points as Defender of Catan. However, it was his turn and so he continued to build a city to get 13 points himself. The code displayed the end game graphics and said that I won. The end game statistics did show him in 1st place, but I got 50 points for the win.
Hm yeah sounds like the display of you winning was definitely wrong, but I think you still get 50 XP for playing even if you lose. It's your ELO that changes most for a win vs second/third/forth place. Sometimes you break even too so it'll be no change. And sometimes when the AI wins, you don't lose ELO anyway (but you can gain it against an AI), though im not sure on the rules for that