2 or 3 LED colors on a single digital pin

I saw it now.


Please look red line current flow.

This current is not enough to turn on the relay, but it is enough to pull the gate of Q1 to GND and turn it on.
Therefore, in the case of Hi-Z, Q1 is turned on and the red LED lights up.
This is the same LED as for Output Low.
I think, perhaps you were thinking of turning off Q1 and Q3 and turning on the green LED during Hi-Z.
But that didn't happen.

Diodes cannot be used to prevent this.
This is because the route you want to block contains exactly the same route you want to use.