OK Here's some more info.

I chopped the faulty functions off the end of the faulty script and pasted them into a new script, I included the new script straight after the one it was in, so structurally the code would get loaded the same.
The fault still existed.

Here's the clue JCL, now I have this faulty piece of code (there's actually nothing wrong with the code) in a separate script, I can change its position (within reason, to save changing other code).

I moved it down further in the includes so It's actually closer to the code that sets the player pointer.

It now works perfectly.

There were absolutely no mods to the code except change my workaround pointer "my_Player" back to the faulty "player" pointer to test.

Now another test, when I move the script further away from the
end of the script, (ie. closer to the top of the includes.) the pointer becomes invalid again!!

So in a nutshell the faulty pointer becomes valid again simply by moving the functions closer to the end of the loaded script.

I hope this provides some more clues.

Jethro.