Thank you for the comments and thank you for reporting the bug! I also encountered the same bug but it was too late to fix it.
Technical explanation: All cards had an id about their type and I forgot to check if the same card flipped twice. So when you click on the same card twice, first click goes to ChosenCard[0] and second click goes to ChosenCard[1]. Since ChosenCard[0].type = ChosenCard[1].type code assumes that they are paired and assumes that it is a successful match.