How to save-load objects that were spawned?

I did like in this video.

The problem is that it keeps what is already on the map!
If you spawn objects and save, exit and then load, it gives errors!
If you don’t spawn but simply move the objects that are present in the scene, they are saved and no errors!

I found the answer in the same video))
It was necessary to add a spawn function!