I just rewatched 311 and I think, when Rumple called his shadow back and reattached it, Rumple grabbed Pan so the shadow bonded the two together, Pan couldn’t escape. When Rumple stabbed Pan, because they were bonded together, Rumple was affected too.
OH! Was that the little spark of electricity?
"He was a lot of things to me" "The only conclusion was love"