Summoned troop appeared in enemy slot

This happened to me a while back, see [Reported] I summoned a Baby Dragon on the Enemy's Side! - #3 by Oreochromis

It’s an intermittent bug, so hard to fix.