Appears to also affect versions back to 1.17
Using Linux (Mint 21 Vanessa) and running Minecraft from the official .deb launcher.
When trying to use /commands on multiplayer servers, the application suffers a memory leak (exit code 6 or 9). When pressing / to begin to enter the command appears to be where the issue begins, as it will temporarily hang the game, and then either allows entry a few seconds later, or crashes out back to the launcher.