### Godot version

master ([06ccbfe](https://github.com/godotengine/godot/commit/06ccbfe8eec6e840db3df2360dc2804386f940b8))

### System information

PopOS 22.04

### Issue description

Sometimes the doc page is broken when the engine is closed and then restarted.
Closing the doc and opening it again fixes it.

![2023-05-27_22-15](https://github.com/godotengine/godot/assets/3624853/ed202a55-03e8-420a-bc1c-ccfc7f7cd02a)


### Steps to reproduce

- Open a documentation page for any node
- Restart Godot

### Minimal reproduction project

NA

EDIT : Added the commit hash @Calinou 
if (!is_inside_tree()) {
		return;
	}
	MutexLock data_lock(data_mutex);
	Rect2 text_rect = _get_text_rect();
	int ctrl_height = get_size().height;
	int fi = main->first_invalid_line.load();
	int total_chars = main->lines[fi].char_offset;
	float total_height = (fi == 0) ? 0 : _calculate_line_vertical_offset(main->lines[fi - 1]);
	for (int i = fi; i < (int)main->lines.size(); i++) {
		total_height = _shape_line(main, i, theme_cache.normal_font, theme_cache.normal_font_size, text_rect.get_size().width - scroll_w, total_height, &total_chars);
		updating_scroll = true;
		bool exceeds = total_height > ctrl_height && scroll_active;
		if (exceeds != scroll_visible) {
			if (exceeds) {
				scroll_visible = true;
				scroll_w = vscroll->get_combined_minimum_size().width;
				vscroll->show();
				vscroll->set_anchor_and_offset(SIDE_LEFT, ANCHOR_END, -scroll_w);
			} else {
				scroll_visible = false;
				scroll_w = 0;
				vscroll->hide();
			}
			main->first_invalid_line.store(0);
			main->first_resized_line.store(0);
			main->first_invalid_font_line.store(0);
			
			total_height = 0;