### 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)

Array keys = p_source.keys();
	Array values = p_source.values();
	for (int i = 0; i < keys.size(); i++) {
		int32_t value = values[i];
		if (value >= 0) {
			hb_feature_t feature;
			if (keys[i].get_type() == Variant::STRING) {
				feature.tag = _name_to_tag(keys[i]);
			} else {
				feature.tag = keys[i];
			}
			feature.value = value;
			feature.start = 0;
			feature.end = -1;
			r_ftrs.push_back(feature);
		}
	}
}
void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_start, int64_t p_end, hb_script_t p_script, hb_direction_t p_direction, TypedArray<RID> p_fonts, int64_t p_span, int64_t p_fb_index, int64_t p_prev_start, int64_t p_prev_end) {
	RID f;
	int fs = p_sd->spans[p_span].font_size;
	if (p_fb_index >= 0 && p_fb_index < p_fonts.size()) {
		
		f = p_fonts[p_fb_index];
	} else if (OS::get_singleton()->has_feature("system_fonts") && p_fonts.size() > 0 && ((p_fb_index == p_fonts.size()) || (p_fb_index > p_fonts.size() && p_start != p_prev_start))) {