It worked before. Kennedy's moon shot speech was 8 years and 2 months before Apollo 11 landed on the moon. The speech was made before the US had put a person in orbit.
Of course, that time around it lead to the Apollo 1 fire killing the first crew in on-the-ground testing before they even got as far as trying to launch them into Earth orbit. Probably not something to be looked up to.
I would bet that the astronauts in the Mercury, Gemini, and Apollo programs thought there would be more than one fatal spacecraft failure by the end of Apollo. A number of astronauts (who never got to space) also died during training (in aircraft crashes in other incidents).
It's a reach to suggest that the pressure to get to the moon directly caused the Apollo 1 fire. There's no evidence that the engineering decisions that led to the fire or the poor escape hatch design would have been avoided with a longer timeline, many of them were choices made in reaction to near death experiences for previous accidents - in particular, both the choice of pure oxygen and the hatch design.
It definitely works, and you might argue that when it comes to forwarding humanity, then what of a few exhausted engineers! But in other contexts perhaps not an elegant methodology.
The get attention because the incredible things they already do. If they were some random company that had not done much nobody would care. However with SpaceX its actually reasonable to believe that they will actually do it in the next couple years.
Probably... the Falcon Heavy rocket has been "only a year from its first launch" for about 6 years. That said, I think they're probably correct about it now
It seems to a preferred motivation method though.