The following is all conjecture

What you see in the text is the waving white flag emoji, a zero, and the rainbow emoji. The rainbow flag emoji isn't an emoji in itself, it's made of three characters: waving white flag, a character called variation selector 16 (VS16 for short), and the rainbow. What VS16 does in this case essentially is tells the device to combine the two surrounding characters into one emoji, yielding the rainbow flag (this is similar to how skin tone modifiers work, but not exactly the same). The text you're copying is actually waving white flag, VS16, zero, rainbow emoji. What I'm assuming is happening is that the phone tries to combine the waving white flag and the zero into an emoji, but this obviously can't be done. Usually the phone wouldn't try to do this, but it notices that the rainbow emoji is also there, and knows that it can combine the white flag and rainbow emoji, so it tries.