I don't believe this is correct. From ncfa.org (https://nfca.org/web_docs/store/ATECBeyondBasicsOfScoring.pdf - page 51):A run resulting from a K-WP could also be unearned depending on how the inning plays out.
5. Bases gained by the following, and where the runner scores, result in an earned
run (defensive interference is considered an opportunity for a putout):
a - Hit,
b - Sacrifice bunt or sacrifice fly,
c - Stolen base,
d - Fielder's choke (putouts on succeeding runner),
e - Bases on balls,
f - Batters hit by pitch,
g - illegal pitch, and
h - Wild pitch (including a third strike wild pitch where the batter
reaches first base safely).