CT wins the round but the first who votes is a Terrorist. The swap isn`t happening (if i[as a CT] choose to be a Terro).
CT wins the round and they are the first who votes. The swap is happening and all is ok. (if i[as a CT] choose to be a Terro it will swap me).
So the bug is that even if a team win the kniferound and the first player who votes if from the opposite team (the team that lost) the swap is not happening, but if the first player that votes is from the team that won, they will be swaped.