IFF can be spoofed and things get confusing when both sides are using the same plane.
The American C-47 and Japanese L2D during WWII is just one example. They're both legit DC-3 variants. The Japanese didn't just buy some before the war. They acquired a licence to build them and got the blueprints.