I’d argue that Li should be red and Hg should be yellow.
Elemental mercury in liquid form is fairly safe. It needs to get into your blood in order to be a problem, and even if some does stick to your tongue and get swallowed the digestive absorption is extremely low.
You stated the reason yourself. Those are different values and matching in a case-insensitive manner is more work under the hood.