WidgetKit widget is blank when app is installed from TestFlight

In our latest release, we noticed that the widget is blank when installed from TestFlight. This does not happen when we install the app from Xcode. The app is built using Xcode 15, and we have started using the new containerBackground API. But still the widget is blank when added. It can be resolved by restarting the device...But this is not a viable solution for our end-users.

It only happens when using iOS 17 or iOS 17.1 Beta. When downloading the app from TestFlight on iOS 16, it works fine.

I have tried looking in the console for any error, and found these:

placeholder reload: No content - initial, (entry protected by: <private>)
[[{BUNDLEID OF OUR WIDGET}:systemSmall:435336647345160163:(null)]] Security policy determined view will be empty: Keybag unlocked; Policy would prefer live entry, but couldn't find one to show; Couldn't find a placeholder to show.
Content load failed: initial search for an existing archive was not found; session will be creating the content on demand:

I'm seeing this also occasionally but can't figure out why exactly.

I'm wondering maybe if it's something like the timeline being reloaded while device is locked, and then trying to access something like HealthKit (which is unavailable when locked).

WidgetKit widget is blank when app is installed from TestFlight
 
 
Q