This is caused by the most recent launcher update (2.3.481) changing something that causes the path returned by java.nio.file.FileSystems#getDefault to return the Install directory (also shown in the launcher_log.txt as the App Directory and Game data directory) rather than the Game Directory (the folder that has the saves folder in it). I have confirmed this using a remote debugger attached to MC.
Unlike when running in a vanilla enviroment, Curseforge tells the Minecraft Launcher to use a different directory to store things like the assets and versions folders in a seperate folder to 'instance' folders/files like saves, mods and options.txt, rather than the same one like is the launchers default behaviour (default behaviour is using AppData\Roaming\.minecraft for both core game files (like assets) and 'instance' files like saves and options.txt). CurseForge does this so only one copy of the core game files can be shared across multiple instances. You can do this without CurseForge too by changing the Game Directory per installation.
Downgrading the launcher by reinstalling it fixes the issue, until it updates again.
This may be reproduceable in a vanilla enviroment by making the Game Directory for an installation a different directory than .minecraft, although I am not sure if anything in vanilla uses FileSystems#getDefault to get a location to read/write files files somewhere.
I can confirm this is an 'issue' with vanilla everything too, although it is not as severe to cause a crash like modded environments, it still has resulted in changes to behaviour.
Steps for reproducing:
Make a new installation in the launcher and change its game directory to somewhere other than the default .minecraft
Launch this new profile and open a world. Say something in chat
Now open the folder you set the game directory to. Notice it does not have a logs folder.
Open the default .minecraft folder. Notice it does have a logs folder. Open that and then open the latest.log file
See that this is the log from the world you joined and that your chat message is in there.
Launcher log from my running of the above steps:
Before 2.3.481 the logs for each instance would be stored in the intance's Game Directory and not in the default .minecraft folder. (However I cannot test on earlier launcher versions with vanilla because I cannot figure out how to downgrade it).
While this could be a purposeful change (as folders like saves, resourcepacks and files like options.txt are still in the instance directory), this is a big change for mods and breaks any that are launched using the vanilla launcher and with a game directory other than .minecraft set (which is a common thing to do so that mods do not affect any vanilla worlds and such). It encourages using alternative launchers because they do not break mods like this, and I know Mojang prefers if people use the vanilla launcher instead of alternative ones.
I also tried with a debugger attached to vanilla and the previously mentioned FileSystems#getDefault method is returning the path to .minecraft instead of the Game Directory set, like before.