There are sections missing such that it’s difficult to follow the logic directly. Here are some thoughts to help debug.
Are you sure you’re not calling the loading section more than once? Just before you save, print the number of elements in the array being saved then print number of elements again just after the load. Make sure these match.
When you’re in a situation like this, sometimes the best thing to do is remove all code and get down to the basics steps which in your case is, adding an element to an array to be saved, save it then read it back and make sure it matches. That means getting rid of all the for loops and getallactors, etc. Simply add a fake transform to the array, save and read it back. If that doesn’t work then then entire system is broken (highly unlikely), if it does then you know you have something off with your implementation. From there you can start adding functionality back slowly to see where things go awry.