This has been an issue for quite some time. It would be really nice it it was added to the Known Issues and Limitations. Or if Plex would follow the default audio codec flag, it’s only been a suggestion since 2018.
HERE is the thread that caused me to do a lot of trial and error and come to the same conclusion. For me to have Atmos and DTS:X I had to remux everything to change codec order.