Ziqiao Chen,
Thank you very much!
The key was that the app-group should be without a dot after the team-identifier ($(TeamIdentifierPrefix)com.my-company.my-app), but the suiteName provided to the UserDefaults initializer init(suiteName:) should be with a dot (.com.my-company.my-app)
I had tried to have both with a dot and both without a dot and neither worked.
By the way according to the official documentation the app-group should be with a dot:
https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.security.application-groups
"For macOS:
."
But anyway - thank you a lot once again!
Best regards,
Antonia