Godot Version
4.6.3-stable_win64
Question
I'm relatively new to Godot. I don't understand why I can parent a new Panel to a Node with path World/Main2, but I can't parent it to the scene root Node3D. I can add a Panel as a child of the scene root outside of Play mode but I don't understand why it doesn't work with code so I am wondering why this is happening. I attached 2 screenshots showing the parent doesn't get set if I make the one small change in the parent's path.
Any errors in the debugger?
Are you getting any error messages? If this tries to add a child to a parent node in _ready(), I would expect this to cause an error like: “Parent node is busy setting up children, add_child() failed. Consider using add_child.call_deferred(child) instead.”
I didn’t have any error messages, but call_deferred fixed it. Thanks
That’s strange. Are you sure you looked at the right place? Because if you’re trying to add a sibling from _ready(), the engine will always complain, issuing this error and suggesting you to make a deferred call:

oh you’re right thanks. I was looking for errors in the output section, i didnt know about the debugging section. Thanks