It shouldn't do that. I have 2 theories as to why this happened.
1) It was a bug. (I don't buy it, because it hasn't been reported before so far as I know.)
2) The opponent had a reflective shield out. This returns the damage back to you. Was it a
or
shield? If so, it may have been reflective.