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"?
Mac Pro dual-2.4 GHz, 10.13.6, 24 Gb RAM, 250 Gb Samsung EVO SSD/Velocity Solo PCIe card, 2x3Tb Seagate HD, 1x3Tb Hitachi HD, Dell 2408WFP; Canon PIXMA iX6550; CanoScan 8800F; MacBook Air 1.8 Ghz, 8 Gb RAM, 10.14.6, 256 Gb SSD; Vodafone Home Hub/BT Wi-Fi Extender.