### Godot version

4.1.rc2

### System information

MacOS 13.4.1

### Issue description

![image](https://github.com/godotengine/godot/assets/4489798/cf4d2074-7d8a-48d4-ba87-ba04d7f2dda1)
Scrollbar does not show when output values are provided after starting the game. Also, it does not scroll to the bottom automatically need to press the search button to show the scrollbar or any button that refreshes the output window.

### Steps to reproduce

1. Create a project
2. Run in _process function a `print()` with some values to output it in the `output window`
3. Turn the game on and off until the scrollbar stops appearing.

### Minimal reproduction project

[ScrollbarBug.zip](https://github.com/godotengine/godot/files/11924845/ScrollbarBug.zip)

}
				
				const int available_width = p_width - theme_cache.table_h_separation * (col_count - 1);
				int idx = 0;
				for (Item *E : table->subitems) {
					ERR_CONTINUE(E->type != ITEM_FRAME); 
					ItemFrame *frame = static_cast<ItemFrame *>(E);
					int column = idx % col_count;
					float prev_h = 0;
					for (int i = 0; i < (int)frame->lines.size(); i++) {
						MutexLock sub_lock(frame->lines[i].text_buf->get_mutex());
						int char_offset = l.char_offset + l.char_count;
						int w = _find_margin(frame->lines[i].from, p_base_font, p_base_font_size) + 1;
						prev_h = _shape_line(frame, i, p_base_font, p_base_font_size, w, prev_h, &char_offset);
						int cell_ch = (char_offset - (l.char_offset + l.char_count));
						l.char_count += cell_ch;
						t_char_count += cell_ch;
						remaining_characters -= cell_ch;
						table->columns[column].min_width = MAX(table->columns[column].min_width, ceil(frame->lines[i].text_buf->get_size().x));
						table->columns[column].max_width = MAX(table->columns[column].max_width, ceil(frame->lines[i].text_buf->get_non_wrapped_size().x));
					}
					idx++;
				}
				
				int total_ratio = 0;
				int remaining_width = available_width;
				table->total_width = theme_cache.table_h_separation;
				for (int i = 0; i < col_count; i++) {
					remaining_width -= table->columns[i].min_width;
					if (table->columns[i].max_width > table->columns[i].min_width) {