What would happen?
The glitch Pokemon would both fight each other as normal. The game may also freeze, or other strange/abnormal events may occur. It also depends on the glitch Pokemon your are facing, some may cause different things to others, such as when the Bad Egg hatches it creates a irremovable empty slot in the party. Basically if the Pokemon used an invalid or hacked move or something like that, almost anything could happen.