It was taught in a Beraita: One may not read by lamplight (on Shabbat) lest he tilt the lamp .
Rabbi Yishmael ben Elisha said: “I will read by lamplight and I will not tilt the lamp.”
It once occurred that he was reading by lamplight on Shabbat and sought to tilt the lamp, but caught himself in time. He declared: “How great are the words of the Sages because they said ‘One may not read by lamplight (on Shabbat).’”
Rabbi Natan stated a different version of the above in which Rabbi Yishmael read by lamplight on Shabbat and actually did tilt the lamp. He then wrote in his notebook: “I, Yishmael ben Elisha, read by lamplight on Shabbat and tilted the lamp. When the Temple is rebuilt I will bring a fat (i.e. fine) Chatat  offering. (Gemara Shabbat 12b)
Elsewhere in the Talmud we are taught that God always protects the righteous from inadvertent transgression (Gemara Ketubot 28b). Why, then, was Rabbi Yishmael not protected from tilting the lamp? Ritva  explains that Rabbi Yishmael did not merit protection because he transgressed his colleagues’ prohibition against reading by lamplight on Shabbat.
It is interesting to note that the Beraita above stated a Rabbinic law followed by its rationale, whereas the Mishnah (on Gemara Shabbat 11a) taught only the law, without the rationale, i.e. ‘One may not read by lamplight (on Shabbat).’ Accordingly, the Vilna Gaon  elucidates that when Rabbi Yishmael ben Elisha said: “How great are the words of the Sages because they said ‘One may not read by lamplight (on Shabbat)’”, he meant: how great is the wisdom of the Sages who taught the Halachah but did not continue and teach the reason ‘lest he tilt the lamp’ – so that no one should say that the reason does not apply to him and inadvertently sin!
The same theme is mentioned in Gemara Sanhedrin 21b: “Why were the reasons for the Torah’s laws not revealed? Because two verses did reveal their reasons and even the great King Solomon faltered with them. For instance, the verse states in Devarim 17:17: ‘A king should not have many wives lest his heart turn away’ but Solomon said: ‘I will have many wives and not be led astray.’ Later, we read that his many wives did in fact cause him to turn away from God (Melachim I, 11:4). ” 
1. The Beraitas are supplements to the Mishnah, forming part of the Oral Law.
2. It frequently occurs that the oil in a lamp draws away from the wick, causing the light to dim. This is usually rectified by tilting the lamp, thereby moving the oil towards the wick; this would constitute kindling, which is one of the forbidden activities on Shabbat. (Rashi)
3. Chatat is translated as a sin offering. It is brought for unintentionally transgressing a Torah law for which the penalty would have been lashes or excision if the transgression had been intentional (VaYikra 4:2 & Rashi). For instance, the unintentional desecration of Shabbat.
4. Ritva is an acronym for Rabbi Yom Tov ben Avraham Ashbili (1250-1330).
5. Cited in MaHaRatz Chayot
6. King Solomon did not actually build an altar for idolatry, but he did not protest against his wives who worshipped idols. (Gemara Shabbat 56b)
7. The other example brought in the Gemara is where Solomon failed to observe the verse in Devarim 17:16