Problems with scoreboard id linking system

I've followed this one tutorial from Cloudwolf [https://www.youtube.com/watch?v=685vs5hNQmk&t=314s&ab_channel=CloudWolf] in 1.20.4 which allows me to link entities with scoreboards. However, when i have 2 or more entities that i want to link to players with said system, it just fails. For example, if i have 2 minecarts with one having "1" as the id and the other having "2" as the id, if the player's id is "1" the minecart with id "1" will refuse to teleport to the player. I don't know why this may be the case, and will be happy if anyone is willing to help.
Continue to help post