Pilot in command can deviate from regulations to the degree necessary to address the emergency. It’s very well established, drilled into every pilot and there truly won’t be any trouble for invoking this.
The question isn't about whether you can get in trouble for invoking it. The question is about whether or not invoking it indemnifies you from the consequences of the deviation from regulations. I.e., sure you can imagine it and not be punished for violating regulations, but if what you do that violates them is reckless, wrong, unnecessarily dangerous, are you still protected from punishment.