There’s a perception that participating in the Home Run Derby makes a player more likely to have a poor second half, with the people who put forth that argument focusing on a handful of prominent cases for support.
However, as Derek Carty of The Hardball Times showed in a study last year, reality doesn’t match perception:

Despite conventional wisdom, it doesn’t look like derby participants play any worse in the second half of the season (on the whole). If you’re looking for the results in terms of percentages, 57 percent of derby participants outperform their projections in the second half.

He also found that even when participants advance to the later rounds of the Home Run Derby or hit an exceptional number of homers during the contest “we still don’t see any signs of a second-half decline” from the whole sample size being studied.
I’m just fine with players turning down Home Run Derby invites for whatever reasons–because, really, who cares?–but to blame the contest any time a participant has a poor second half is off base.

Harvey, 29, spent 2018 with the Mets and Reds, posting an aggregate 4.94 ERA with a 131/37 K/BB ratio in 155 innings. He started off poorly with the Mets, so they traded him to the Reds in early May. He pitched much better in Cincinnati.

Harvey should have a spot secured at the back of the Angels’ rotation, but health and performance can always change that leading up to Opening Day.