Finally, I managed to get it working! I’m not sure if the information I saw on other sites is incorrect or if Apple recently changed something, as several sources mentioned that the keychain-access-groups needed to be added to the entitlements.plist. I moved this key to the info.plist, and it finally worked!