I think I found a bug during a battle I was just in. I was fighting against a Fun Old Man (don't remember his name) in Agate village and his Pidgeotto used substitute. The Pidgeotto had around 10% HP remaining, after using the move, and when I attacked it with a shadow move, the damage went through the substitute and KO'd the Pidgeotto