That's pretty weird. I can't figure out how a file could dictate audio output. Get Info might be something to look into, though.
I would Get Info the .mp4 file and see what is selected under "Open with:" Is is different that a file that plays correctly? Change it to whatever does play correctly and see if that works.
What do you have selected in Sound Preferences when the .mp4 file is playing incorrectly? I don't have AirPlay. Does it show up in Sound Preferences as a "device for sound output"?
iMac (19,1, 3.1 GHz i5, 10.14.6, 40 Gb RAM) with Mac Pro (5,1, dual-2.4 GHz, 10.13.6, 24 Gb RAM) used as a server and to run 32-bit apps via Screen Sharing. MacBook Air (1.8 Ghz, 8 Gb RAM, 10.14.6, 256 Gb SSD) all patched through a Vodafone router and BT Wi-Fi Extender, Canon TS8351 printer/scanner.