Exactly the same happens to my XS since iOS 12.1.1 including the latest official release (12.1.2) today.
70-80% of the time it has no sound, and during this i mean really no sound like music, video, ringtone, notification and alarm clock.
When i reboot the phone all things are working properly for some hours until this issue returns.
In the last weeks i overslept more than 5 times, and i still don't know if this happens again tomorrow.
Simply said, my device is nearly useless at the moment.
On my own i tried all things I can find, like Headphone mode, maybe connected Bluetooth speaker, DND mode and so on... (and yes i read the audio related Apple support articles)
After that i tried a full reset and restore over phone settings, and a full reset with new Firmware over Itunes.
Each of this one time with a Backup over iCloud, one time with Backup over iTunes and latest without a Backup (new Phone).
Everytime the issue returned some time later.
Then my XS was replaced due to AppleCare+, unfortunately the same happens with this replacement device again.
At this time i am sure, that this can only be a software issue.
As a full time software developer and due to my experience with apple devices i know, that i can create a software log with the official Apple configurator utility which is available in the mac AppStore.
So i created such a logfile at the time, when the issue returned and without surprise i got several iOS API errors related to CoreAudio API on the device.
Then (last week) i told the customer support the whole story again, and in the end i was asked to upload this log for the software engineers to Apple.
Since this day i have no response from Apple, but i will call them again tomorrow.
So please Apple, look for this issue.
A device with this kind of issue isn't a phone anymore. This is not more than paperweight.