I'm not sure what is causing this problem, but as I solved it (or rather worked around it) I decided to share my discoveries, to spare your time and for the future reference.
So the story goes like this:
I bought a new Gigabyte's X570 Aorus Master motherboard and installed Arch Linux there. Audio was not outputted by the rear 3.5 mm socket, something was wrong.
The process of getting to the solution is described below, in the answer. The details there may let you know if you are in the same situation.
Also, if you have better solution, that would fix the unerlying issue, and not just work around it at the cost of the digital output, feel free to post your answer! I won't be accepting my answer in hope that someone will come up with something better.