Error when trying to request Authorization from AuthorizationCenter.

I am trying to build a screentime app using the screentime api. I have basically copied the code from here: https://developer.apple.com/videos/play/wwdc2022/110336/ at timestamp 3:14. But when I run my code on an emulator I get the following error message:

Failed to enroll Aniyah with error: Error Domain=FamilyControls.FamilyControlsError Code=3 "(null)")

And I haven't been able to find much information on that specific error on the web. Here is my code for reference:

import SwiftUI
import FamilyControls

@main
struct WorklogApp: App {
    let center = AuthorizationCenter.shared
    var body: some Scene {
        WindowGroup {
            ContentView()
            .onAppear {
                Task {
                    do {
                        try await center.requestAuthorization(for: .individual)
                    } catch {
                        print("Failed to enroll Aniyah with error: \(error))")
                    }
                }
            }
        }
    }
}

I do not have an apple developer account and I have added Family Controls to my Signing & Capabilities. Any help with this issue would be much appreciated.

Code 3 is an invalidArgument error. Is the device connected to the internet?

And please file this concern with Feedback Assistant so that we can address and track this for you in a timely way. Be sure to reproduce the error, run a sysdiagnose and include that sysdiagnose in your ticket.

Error when trying to request Authorization from AuthorizationCenter.
 
 
Q