### Godot version

v4.0.beta16.official [518b9e580]

### System information

Windows 10

### Issue description

`RichTextLabel` with `threaded` enabled may crash the game or show the following warning if the node is in another scene:

```
W 0:00:03:0802   test.gd:12 @ load_with_scene(): A Thread object has been re-started without wait_to_finish() having been called on it. Please do so to ensure correct cleanup of the thread.
  <C++ Source>   core/os/thread.cpp:76 @ start()
  <Stack Trace>  test.gd:12 @ load_with_scene()
                 test.gd:6 @ load_items()
                 test.gd:26 @ _on_button_pressed()
```

It may crash the game (without any warning) if it's added directly.

In `v4.0.beta15.official [4fa6edc88]` I was able to reproduce the same warning on my project but I can't reproduce it in the attached MRP. I get a different error and will crash too if the node is added directly:

```
E 0:00:03:0019   remove_from_group: Condition "!E" is true.
  <C++ Source>   scene/main/scene_tree.cpp:157 @ remove_from_group()
```


### Steps to reproduce

Click on the  `Load with scene` or `Load with node` buttons in the attached MRP until it shows a warning/error or crashes. It may take a while.

### Minimal reproduction project

[add_chid_bug_b16.zip](https://github.com/godotengine/godot/files/10521402/add_chid_bug_b16.zip)

Item *item = p_item;
	Item *prev_item = p_item;
	int level = 0;
	while (item) {
		if (item->type == ITEM_LIST) {
			ItemList *list = static_cast<ItemList *>(item);
			ItemFrame *frame = nullptr;
			int line = -1;
			_find_frame(list, &frame, &line);
			int index = 1;
			if (frame != nullptr) {
				for (int i = list->line + 1; i <= prev_item->line; i++) {
					if (_find_list_item(frame->lines[i].from) == list) {
						index++;
					}
				}
			}
			r_index.push_back(index);
			r_list.push_back(list);
			prev_item = item;
		}
		level++;
		item = item->parent;
	}
	return level;
}
int RichTextLabel::_find_margin(Item *p_item, const Ref<Font> &p_base_font, int p_base_font_size) {