Well, after reading your comment I changed my test slightly. What I did before was rezzed a certain number of objects and stored the keys reported by object_rez in a list. Then went through the list linking them via a link function I wrote. This worked as long as you asked for permissions prior to calling the link function, but if I only asked for permission at state_entry it would silently fail.
After reading your response I changed the script to link each object as the keys were reported by object_rez. Doing it this way seems to work every time. I will have to think on this more, but as always, LSL can be a bit unpredictable.
Thanks for your response and test.