This is similar to a previous question (... accuses another of doing something which they did ...) but more generalized. Two examples: A German woman athlete falsely accused other women athletes of being men; it transpired that she was a man. Similarly, Trump repeatedly called Clinton "Crooked Hillary." Who was the real crook? In my personal experience, this is a very common phenomenon. One suggestion was "Projecting." Does this imply deflection? One conclusion to the original question was that a new word needed to be coined. I propose the word "Gasblagging." (see Gaslighting and Blagging.)
While I vote +1 for "gasblagging", the common term is projecting. https://en.wikipedia.org/wiki/Psychological_projection
Psychological projection is a theory in psychology in which the human ego defends itself against unconscious impulses or qualities (both positive and negative) by denying their existence in themselves while attributing them to others.
The origin of the theory is Sigmund Freud