I recently encountered an error that has caused quite some trouble.
As an insight into what was going on:
I wanted to save the main game scene into a PackedScene that can be loaded from the title screen scene;
Everything worked as intended, minus the fact that the integral nodes (the nodes responsible for level chunks) were seemingly deleted in the saving process.
I skimmed through the saved PackedScene file only to find that it was nowhere to be found, and before anyone brings this up, some random function from my code isn't responsible for this deletion either.
What makes it more puzzling is how I achieved PackedScene saving in a different node (a chunk one) and didn't encounter any issues.

Here is the code snippet:

var saved_world = PackedScene.new()
saved_world.pack(get_tree().get_current_scene())
ResourceSaver.save(("user://user_worlds/" + str(world_id) + ".tscn"), saved_world)
  • Ertain Oh, my mistake, I had gotten this mixed up with another issue that was resolved before I could make a forum post about it. All I did was simply add those level chunks to a group, and then fetch all the nodes from that group. After fetching those nodes, I saved each of those nodes so that I can later fetch those nodes again to reload them into the scene.

Maybe it has something to do with node ownership? As per the documentation on a PackedScene node (emphasis is my own):

Can be used to save a node to a file. When saving, the node as well as all the nodes it owns get saved (see Node.owner property).

    Ertain Oh sorry for the slight inconvenience, I have already solved the issue on my own terms. It was related to an issue unrelated to PackedScene. Your answer does bring up a good point, and I will look into it in the future.

      Ertain Oh, my mistake, I had gotten this mixed up with another issue that was resolved before I could make a forum post about it. All I did was simply add those level chunks to a group, and then fetch all the nodes from that group. After fetching those nodes, I saved each of those nodes so that I can later fetch those nodes again to reload them into the scene.