no primary challenger has ever beaten an incumbent for president
So, a bit of history.
https://time.com/5682760/incumbent-presidents-primary-challenges/
Before primary elections became the dominant way to pick a nominee, party leaders were more able to either shut down challengers or smoothly pass the nomination to someone else. Notably, four incumbents who were denied the nomination in the 19th century — John Tyler, Andrew Johnson and Chester A. Arthur — had been Vice Presidents who rose to the Presidency following the deaths of their predecessors, perhaps suggesting they’d never won their parties’ full support in the first place.
Then
In the 1952 Democratic Party presidential primaries, President Harry S. Truman was challenged by Senator Estes Kefauver. Truman lost the New Hampshire primary to Kefauver and dropped out of the race shortly after.
Also
TIME reported that McCarthy’s surprisingly strong showing in the New Hampshire primary was a statement that was “as much anti-Johnson as antiwar,” citing a NBC poll that found more than half of Democrats didn’t even know McCarthy’s position on Vietnam. Less than a week after New Hampshire, Attorney General Robert Kennedy jumped into the race. Then, on March 31, Johnson announced he wasn’t going to run for re-election.
As TIME reported in the April 12, 1968, article on Johnson dropping out, “So low had Johnson’s popularity sunk, said one Democratic official, that last-minute surveys before the Wisconsin primary gave him a humiliating 12% of the vote there.”
It should be noted that Ford nearly lost to Reagan in 1976
He racked up 1,187 delegates compared to Ronald Reagan’s 1,070, which was barely more than the 1,130 he needed to secure the nomination.
And Kennedy nearly beat Carter four years later
Carter won 36 primaries that year, but Kennedy’s 12 victories included important ones in New York and California, and he didn’t concede until Aug. 11, 1980, at the Democratic National Convention at Madison Square Garden in New York City.
In another historic race, William Taft was nearly edged out by Theodore Roosevelt, who went on to place second behind Woodrow Wilson in 1912. That gave Taft the dubious distinction of being the only incumbent to come in at third place in a general election.