A player has been substituted and is leaving the field of play. Just before he steps off the pitch the player says something for which the ref issues him with a second yellow card. Technically he sent off a substituted player but instructed the players team to play with ten men.
Is that the right course of action or should they have been allowed to play on with eleven as the red carded player was a subbed player but still on the pitch?
It is essential that the substitution procedure as set out in Law 3 of the Laws of the Game is followed exactly. The substitution is not fully complete until the player being substituted has left the field of play and the substitute has stepped on the field of play. You will notice at the highest level how the 4th official prevents the substitute stepping on to the FOP until his team mate has left. It is to ensure that there is a defined moment for the substitution to be deemed completed.
So in your scenario the player as he is still on the field of play is still a player and as he received a 2nd caution for dissent the player is dismissed with the team playing short. Had the player left the FOP and the substitute stepped onto the field of play the player is then a substituted player who can still be cautioned / dismissed but the team would not play short as the substitution has been completed.
So the referee was entirely correct as he deemed the substitution was not completed as per Law 3