The gemara on 3b has a discussion whether the Rabbonon would make a gezeira or k'nas to prevent someone from doing an action that will save them from a Torah violation. The two examples are when one sticks out their hand holding an object from reshus hayachid to reshus harabim - would chachamim forbid him from drawing his hand back into reshus hayachid? By preventing him from drawing his hand back, he is likely to let go of the object as the hours of shabbos pass, thereby violate an issur d'oraysa. Similarly, if one stuck bread to the side of an oven on shabbos, would the chachamim prevent him from removing it (which is generally a rabbinic prohibition), or would they be lax since by preventing the removal of the bread, he will violate a Torah prohibition. The issue that is being discussed is whether the Rabbonon would impose a restriction that will cause a torah violation. One possibility is that they wouldn't, but another possibility is that they would look at the bigger picture and by imposing an issur, although in this case they will be causing a chilul shabbos, in general they will be preventing chilul shabbos. Although by the removal of the bread we conclude that one is allowed to remove it, by the hand that one stuck out on shabbos, many rishonim pasken that if done b'meizid we forbid him from drawing his hand back in.
However, Tosafos d.h. kodem, asks a very interesting question. Regardless of whether chazal would or would not impose the prohibition, who would listen to them? Tosafos asks that if by listening to them one would receive capital punishment, one would certainly not listen. But even if one wouldn't actually receive capital punishment, when faced with the possibility of a Torah violation or a Rabbinic one, wouldn't it make more sense to violate the Rabbinic prohibition? Tosafos answers that by the chachamim preventing you from pulling your hand back or from removing the bread, they are actually making it so that the violation was purely b'ones, and one is not liable for that. Meaning, by imposing their restriction they are essentially reducing the violation by making it so that the individual is אנוס בתקנת חכמים, and therefore not liable for the initial violation. According to this it makes more sense why chazal would consider imposing the restriction since even for the individual case, they are not making things worse for the person, they are actually making things better for him because even if decides not to fix the problem, he won't be chayev for his violation. However, if they don't impose the prohibition and one decides not to fix the problem (such as by removing the bread or withdrawing his hand) he will be chayev for the violation.