The point is this happens as part of a default Scheduled Task, not how the shell handles it if you click an invalid shortcut.
It's not about security. If IsBadXXXPtr fails, the pointer is invalid. If it suceeds, the pointer might still be invalid. So basically making any decision on it is entirely pointless.
Checking something global exists/is valid then following up by attempting to do something based on the assumption that it is valid is fundamentally flawed on a multitasking OS. The only valid way to do it is to perform the action and respond correctly to a failure, but obviously that's not an option here and as such there is no correct way to write this functionality and it shouldn't exist at all.