The gemara says that R. Yehuda gave malkus to someone who clipped the wings of a bird and then sent it away on its feet to fulfill the mitzvah of shiluach hakein because he holds that it must be sent away by flying, not by hopping. The Mishneh L'melech (hil. avadim 18) asks how he was able to punish for this mitzvah. We have a rule - כל מצות עשה שמתן שכרה בצדה אין ב"ד של מטה מוזהרין עליו, meaning that Beis Din doesn't punish for any mitzvah that has a reward tagged onto it. How was R. Yehuda able to punish for shiulach hakein which has the reward of long life attached to it?
The Maharatz Chiyus suggests based on Rashi (?) that the reason that beis din doesn't punish when there is a reward attached is because by writing the reward the torah is hinting that the this is the reward for doing it and not receiving this reward is the punishment for not doing it, to the exclusion of any other punishment. The Maharatz Chiyus explains that this rule works by other mitzvos, but by shiluach hakein the mishna 142a says that the reward needs to be written to teach that there is tremendous reward even for small mitzvos such as this for which there is very little expense. From here we derive that for all mitzvos there is great reward, making it unnecessary to dictate the specific reward if not for the purpose of exempting you from any other punishment. Therefore, shiulach hakein is an exception to the rule since it serves as the source for teaching that there is great reward for even seemingly simple mitzvos, and is not meant to exclude any other punishment.
It seems to me that Rashi himself is coming to answer the question as to how R. Yehuda was able to punish for a mitzvah that the torah writes the מתן שכרה בצדה. Rashi says that the purpose of his "punishment" wasn't punitive, rather it was רידוי בתוכחה שלא ירגיל בזה, ואין לה קצבה אלא עד שיקבל עליו. Meaning, the purpose was not to punish, rather to change the person and motivate him to fulfill the mitzvah. Although Beis Din may not "punish" or "penalize" for mitzvos on which a reward is tagged on, they may still have the ability to encourage and motivate one to fulfill the mitzvah even through force.