Since Glitch Pokemon only existed in Gen I, I will only be answering from a Gen I perspective, not from all Gens. Anyway, what would happen is simple, Ditto would transform into the Glitch Pokemon but not gain certain things. Once Ditto uses Transform, it will not change its Sprite into the glitch Pokemon(because it's not a real Pokemon), but it will gain the Glitch Pokemon's Moves. This Video shows what I mean. Again, this Answer is only in the Gen I perspective, because Glitch Pokemon really only existed in Gen I.