Tail lamp issue

Help…so the tail light isnt working it has turned the warning light on. I checked bulb and sockets all good.i followed the sensor check procedure. Source voltage looked good. The white/yellow green/yellow check did not yield the 5 volts. So i suspected the sensor. I sourced a second sensor and it did not light the tail lamp. I find it difficult to believe both sensors are poor. I read here somewhere about this tail lamp possibly involving the key switch is this possible.