I agree ignorance of the law is no defense and people should know the rules.
One of those rules is the yellow timing must be in accordance to the MUTCD and many of these lights fail to meet the minimum standard. In that case you could know the rules and the government changes the playing field (ie the light timing) and you are still required not violate the law.
Many times these types of ticket are civil matter thus you have no rights to have the state prove the light meets the requirements. The light can be complete in violation of the law and you still have to pay. As an example if you in the intersection on when it turns red they ticket you. I personally observed camera taking pictures This also go to confronting your accuser, they will not allow you that defense many times.
If it is all about traffic safety, why all the tricks to keep you from defending yourself.
I am not a lawyer nor am I in law enforcement,
I will not make any value judgment on why you're asking a questions.
I will try to provide information so you can make an informed decisions so take it for what is worth and do your own research.
Remember it is easy to tell someone they will lose verse providing knowledge.
Lastly, I have no vested interest in your outcome win, lose or draw and the same goes for anyone else.