>I would much rather get punched in the face than serve 20 years in prison, but it is illegal to threaten the former, but perfectly fine to threaten the latter.
How about you don't do the action that makes you punishable with 20 years in prison?
On a more practical level, if someone is breaking into your house, should it be illegal to tell them to stop, on pain of you calling the police which presumably would cause them to be incarcerated?