user35430: I have relatively simple code printing some emojis:
void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("Hello world ❤‍♀️‍♂️✔");
}

Just in case it doesn't render very well, here's an image on how it looks like in Arduino IDE 2.0.3:

However, the Serial Monitor sometimes displays emojis and sometimes not. It varies from line to line like so:
Hello world �����������������♀�������‍♂️✔����
Hello world ���������������‍♀️‍♂️✔
Hello world ��❤���������������������������������♂���✔
Hello world ❤‍�������‍�������������
Hello world �������‍♀️��������������✔����
Hello world ��������������♀��������️�����������
Hello world ��❤����������‍�����������♂�������✔���

Again, there's how it looks like on my Windows 10 machine:

I verified that it's not a mistake in the baud rate. Both, Arduino and PC are set to 9600.
In Arduino IDE 1, the output is not colorful and some emojis are not rendered at all, but the result is much more consistent:

How to fix the scrambled output in Arduino IDE 2?

user35430: This is an issue of Arduino IDE 2.0.3. It was reported as issue 589 and issue 1405.
It was fixed on 9th of December 2022 [PR] and I can confirm it is fixed in nightly build 2.0.4-221229.

35430: <p>I have relatively simple code printing some emojis:</p>
<pre class="lang-cpp prettyprint-override"><code>void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(&quot;Hello world ❤‍♀️‍♂️✔&quot;);
}
</code></pre>
<p>Just in case it doesn't render very well, here's an image on how it looks like in Arduino IDE 2.0.3:</p>
<p><a href="https://i.stack.imgur.com/9AvLr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9AvLr.png" alt="Screenshot of code with emojis rendered" /></a></p>
<p>However, the Serial Monitor sometimes displays emojis and sometimes not. It varies from line to line like so:</p>
<pre class="lang-none prettyprint-override"><code>Hello world �����������������♀�������‍♂️✔����
Hello world ���������������‍♀️‍♂️✔
Hello world ��❤���������������������������������♂���✔
Hello world ❤‍�������‍�������������
Hello world �������‍♀️��������������✔����
Hello world ��������������♀��������️�����������
Hello world ��❤����������‍�����������♂�������✔���
</code></pre>
<p>Again, there's how it looks like on my Windows 10 machine:</p>
<p><a href="https://i.stack.imgur.com/qbR5l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qbR5l.png" alt="Screenshot of garbage output" /></a></p>
<p>I verified that it's not a mistake in the baud rate. Both, Arduino and PC are set to 9600.</p>
<p>In Arduino IDE 1, the output is not colorful and some emojis are not rendered at all, but the result is much more consistent:</p>
<p><a href="https://i.stack.imgur.com/FYLnF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FYLnF.png" alt="Screenshot of output in Arduino IDE 1" /></a></p>
<p>How to fix the scrambled output in Arduino IDE 2?</p>
 35430: <p>This is an issue of Arduino IDE 2.0.3. It was reported as <a href="https://github.com/arduino/arduino-ide/issues/589" rel="nofollow noreferrer">issue 589</a> and <a href="https://github.com/arduino/arduino-ide/issues/1405" rel="nofollow noreferrer">issue 1405</a>.</p>
<p>It was fixed on 9th of December 2022 <a href="https://github.com/arduino/arduino-ide/pull/1758" rel="nofollow noreferrer">[PR]</a> and I can confirm it is fixed in nightly build 2.0.4-221229.</p>
