I will take this up from a Kantian point of view
Bob simply cannot morally know the necessary outcome of John's actions, but more relevantly, John is a moral agent, still completely capable of not pursuing any prediction that can be made by Bob. If you cannot be defied, you have stripped other agents of their autonomy, in a way that no human wants to be limited.
Even if my future is knowable, for it to be known, is immoral. To have free access to prediction universally, the prospect of the delight of surprise would be removed entirely from the universe, and we would not will that: it is not compatible with how humans need the world to be. So whatever thaumaturgy might determine John's fate is not moral, and even if we have done it somehow by accident, we should not act on it.
(Kant wants morality independent of species, and this sometimes clarifies arguments. For Kantians who share the religious context of his upbringing, this is the argument against angels, who live outside time and carry the agenda of limiting sin, simply fixing history so the world is perfect. To do so, whatever sin it might prevent, would crush human will.)
So, if Bob knows John's future and acts on what he knows, he is already in the wrong. But that puts Bob in the position of acting inauthentically while trying not to lie. He needs some boundary around what would be expected of him.
Even in the case with no magic, relying on your guesses about someone else's behavior based on observation too much is prejudice, and becomes immoral quickly. John must be treated as a moral agent with autonomy. If we do not allow in every way for the possibility of basic moral change, John can no longer participate in a 'Kingdom of ends', his autonomy is reduced to logic and he becomes a mechanical part of the universe, a mere means.
John then needs to be treated in a way that intends to work out for the best even if he deviated from any prediction we can make, at any point. The only point where Bob can safely control the possibility that John will change the script, and obviate the predicted good outcomes, is in deciding to give or not to give John the money to start with, and that is the only act with predicted consequences that can be judged for moral content.
Giving is a good thing. But it is sometimes not a good idea to just give people money at random. If I gift the policeman who pulls me over with $100, this is not to his ultimate benefit, especially if his camera is on. It proposes moral hazard. So automatic generosity in complete generality is not universalizable.
Any rule about giving needs to incorporate the proviso that it should not cause undue foreseen risks for the recipient that outweigh the gain of the gift. But with this addendum, the idea that giving away resources that you do not need does seem universalizable. So this condition is a natural part of the proper maxim. Kant's "Kingdom of Ends" is a community of ends, and mutual protection at a respectful and sustainable level is part of the package.
John is at risk here, and Bob, knowing of that risk, should provide a level of protection from it that we can generally expect from others, but he should not force John's hand. If John is someone to whom Bob would ordinarily give help, that help should take a less risky form than cash.
This is a risk of which John himself would be aware, so accounting for it, and purposely treating him differently, is not a prediction of the future, or a stereotyping of John into a box we assume he cannot get out of. It is acting on a motive that John should have and would approve of, were his functioning not impaired.