I can confirm that the issue I am describing happens 100% both on device and simulator in this scenario:
Prerequisites:
Phone/simulator is in light appearance (also happens in reverse when in dark mode)
Application written in SwiftUI
Uses CoreData to store entities
Application adds UNNotificationRequest with action to insert entity in CoreData to UNUserNotificationCenter via UNUserNotificationCenter.add(_:withCompletionHandler:)
Application is opened
Go to Home Screen and make application non active (do not force close)
Receive notification
Trigger the notification action without opening the app (hold the notification and tap the action button)
In the code the userNotificationCenter(_:didReceive:) handled it and inserts new entity in CoreData.
Open app switcher
10 Application's labels' text color is switched to white (it was black in light appearance before CoreData interaction)
11. Resume application by opening it, label's text color switches back to white
Here is a video of this scenario
Created a sample project that reproduces the issue, it ca nee found here: https://github.com/VladimirAmiorkov/SwiftUI-Label-text-color-issue
Opened a feedback issue report with ID: FB16412433
Topic:
UI Frameworks
SubTopic:
SwiftUI