score:23
This anecdote is from Walter Scott's novel Quentin Durward. The king is Louis XI. The guy who predicts the future is Martius (Marti) Galeotti, Italian astrologist. The guard who is supposed to kill him at the exit of king's chamber is Oliver, barber and servant of Louis.
I think Scott made it up. But possibly he read this is some historical source. Martius Galeotti (1442-1494) was a real person (see Wikipedia), as well as Oliver and Louis XI.