In football, a yellow card can be given to a player when he/she is losing time on purpose.
Typically, a team wining the match will make changes on the last minutes to lose some extra time: the player will make sure to be far away from the bench, so that the distance to cover will be quite big. Also, he will walk all the way, making the other team feel very nervous for it.
For this, 30 seconds are summed to the extra time to be added to the end of the match. However, in many cases this change takes way more than this.
I was wondering: would it be possible for a player that is being replaced already having a yellow card to get another one for being so slow during the replacement? Would the replacement then be cancelled? Has it ever happened?