### 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 
int to_line = main->first_invalid_line.load();
	int lines = main->lines.size();
	return lines - to_line;
}
bool RichTextLabel::is_ready() const {
	const_cast<RichTextLabel *>(this)->_validate_line_caches();
	if (updating.load()) {
		return false;
	}
	return (main->first_invalid_line.load() == (int)main->lines.size() && main->first_resized_line.load() == (int)main->lines.size() && main->first_invalid_font_line.load() == (int)main->lines.size());
}
bool RichTextLabel::is_updating() const {
	return updating.load() || validating.load();
}
void RichTextLabel::set_threaded(bool p_threaded) {
	if (threaded != p_threaded) {
		_stop_thread();
		threaded = p_threaded;
		queue_redraw();
	}
}
bool RichTextLabel::is_threaded() const {
	return threaded;
}
void RichTextLabel::set_progress_bar_delay(int p_delay_ms) {