### Godot version

Master branch [6758a7f]

### System information

Manjaro

### Issue description

`get_character_line` returns the wrong line on some characters when Autowrap Mode is not set to "Off". I couldn't understand the source of error, but apparently it happens when the text breaks lines in Autowrap "Arbitrary", or when the text auto-formats to remove extra space characters. The following images shows a case when this error happens:

![test1](https://github.com/godotengine/godot/assets/7095429/f8ff8eed-31aa-47ba-824e-2c0f18b1cf8e)
![test2](https://github.com/godotengine/godot/assets/7095429/994ee968-7418-4530-aa94-75eb1d6a9b61)

The problem is obvious on the the last two "c"s that should been on line 4, but instead only the last one is. This offset happened on the second letter "b", that should been line 1 (but it's shown as line 0).

### Steps to reproduce

Use a RichText label and set Autowrap mode to any option but "Off". Some texts might have this problem when you query for a character line.

### Minimal reproduction project

[bug_character_line.zip](https://github.com/godotengine/godot/files/12416662/bug_character_line.zip)

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) {
	progress_delay = p_delay_ms;
}
int RichTextLabel::get_progress_bar_delay() const {
	return progress_delay;
}
_FORCE_INLINE_ float RichTextLabel::_update_scroll_exceeds(float p_total_height, float p_ctrl_height, float p_width, int p_idx, float p_old_scroll, float p_text_rect_height) {