Hi Team
I have a very similar problem when i went to swap my main living room ceiling light. In total i had 3 wires. In each of those main wires i had 3 wires coming out red, black and green.
I had a spare bulb and wire connection so that i could check which one was live and which one was...