On-Demand Resources not working on Release builds (AppStore/TestFlight)

We have received multiple reports that some parts of the app do not work as expected. These features use audio files hosted as On-Demand Resources and it seems that the resource request returns true as expected, but the file behind the tag is missing or empty. We have not touched parts of the code or the resources for a long time now and the failure seems to be on the server side of thing.

They work perfectly fine on debug builds or on simulator, but almost always fail on AppStore and TestFlight builds. beginAccessingResources method does not return any error and allows the app flow to continue. This unexpected behaviour resulted in plenty of crashes on our side due to the fact that returned files where either missing or empty.