I believe I have a theory to explain why would kakashi stab rin. This was probably a trap caused by madara and zetsu to make obito believe he was betrayed and be consumed by hatred. It's pretty simple actually, zetsu got in the battlefield and attacked Rin, absorbing her chakra. Now I believe that zetsu started attacking frequently with Rin's form to confuse kakashi, and eventually, attack the real one. It may not be exactly this idea, but it has definately zetsu and his shapeshifting ability.