Never heard that before, I don't believe it.
Well the story is a lot more complicated, unsurprisingly. There are a couple of great bits of the history, meetings between JFK and NASA's head James Webb and others, one in 1962 and one in 1963.
https://www.history.nasa.gov/JFK-Webbconv/pages/transcript.pdf
JFK Library Releases Recording of President Kennedy Discussing Race to the Moon | JFK Library
Some of it is very funny to read. The 1962 meeting had a lot to do with JFK demanding that the moon landing be the top priority for NASA while James Webb had opposition to parts of that.
"President Kennedy: Do you put…. Do you put this program…. Do you think this program is the top-priority program of the Agency?
James Webb: No, sir, I do not. I think it is one of the top-priority programs, but I think it’s very important to recognize here…and that you have found what you could do with a rocket as you could find how you could get out beyond the Earth’s atmosphere and into space and make measurements. Several scientific disciplines that are the very powerful and begin to converge on this area.
President Kennedy: Jim, I think it is the top priority. I think we ought to have that very clear. Some of these other programs can slip six months, or nine months, and nothing strategic is gonna happen, it’s gonna…. But this is important for political reasons, international political reasons. This is, whether we like it or not, in a sense a race. If we get second to the Moon, it’s nice, but it’s like being second any time. So that if we’re second by six months, because we didn’t give it the kind of priority, then of course that would be very serious. So I think we have to take the view that this is the top priority with us.
James Webb: But the environment of space is where you are going to operate the Apollo and where you are going to do the landing."
"President Kennedy: Look, I know all these other things and the satellite and the communications and weather and all, they’re all desirable, but they can wait.
James Webb: I’m not putting those…. I am talking now about the scientific program to understand the space environment within which you got to fly Apollo and make a landing on the Moon.
President Kennedy: Wait a minute—is that saying that the lunar program to land the man on the Moon is the top priority of the Agency, is it?
Unknown speaker: And the science that goes with it….
Robert Seamans: Well, yes, if you add that, the science that is necessary….
President Kennedy: The science…. Going to the Moon is the top-priority project. Now, there are a lot of related scientific information and developments that will come from that which are important. But the whole thrust of the Agency, in my opinion, is the lunar program. The rest of it can wait six or nine months."
"President Kennedy: The other thing is I would certainly not favor spending six or seven billion dollars to find out about space no matter how on the schedule we’re doing. I would spread it out over a five- or ten-year period. But we can spend it on…. Why are we spending seven million dollars on getting fresh water from saltwater, when we’re spending seven billion dollars to find out about space? Obviously, you wouldn’t put it on that priority except for the defense implications. And the second point is the fact that the Soviet Union has made this a test of the system. So that’s why we’re doing it. So I think we’ve got to take the view that this is the key program. The rest of this…we can find out all about it, but there’s a lot of things we can find out about; we need to find out about cancer and everything else.
James Webb: But you see, when you talk about this, it’s very hard to draw a line between what….
President Kennedy: Everything that we do ought to really be tied into getting onto the Moon ahead of the Russians.
James Webb: Why can’t it be tied to preeminence in space, which are your own….
President Kennedy: Because, by God, we keep, we’ve been telling everybody we’re preeminent in space for five years and nobody believes it because they have the booster and the satellite. We know all about the number of satellites we put up, two or three times the number of the Soviet Union…we’re ahead scientifically. It’s like that instrument you got up at Stanford which is costing us a hundred and twenty-five million dollars and everybody tells me that we’re the number one in the world. And what is it? I can’t think what it is.
Interruption from multiple unknown speakers: The linear accelerator.
President Kennedy: I’m sorry, that’s wonderful, but nobody knows anything about it!"