Let's say you are a judge presiding over case regarding crimes committed by a criminal group. Then, the criminal group tells you to not give them a harsh sentence or else they will get back at you by hurting people that are close to you.
Since they are a powerful and resourceful group of criminals, you take their threat seriously and decide to be on their side. Can you be punished for doing so if it was discovered afterwards? What if they force you to take money, to make it seem like you took a bribe?
Note that you really want to protect your family and friends, and you know that any federal organisation (FBI, CIA, etc) will not be able to reliably protect them (since the criminals are very resourceful).