When we're talking about something a person did (promoting junk science, in this case), it's easy to use the meaning of
setting a bad example. It's usually clear from context whether the example is 'terrible to follow' or 'terrible at explicating'.
You might prefer a nonambiguous wording, but the current wording is valid, and not a grammatical error.
For the pain example, think of "a terrible example of how to excruciatingly injure yourself" as a phrase that's easier to use in either context.