When changing the audio output source (e.g. when plugging in / plugging out your headphones), Trackmania doesn't automatically switch the audio output. While other audio sources (Spotify, Browser, Discord, etc.) automatically switch to the new audio device (the headphones, when plugging them in), Trackmania does not, and the game sound is still coming from the speakers. You need to toggle the audio device once in the settings and then can go back to "default" to make it work as well, but this is an unnecessary extra step.