WatchOS background task is not triggering

Hello,
I have an Apple Watch app, that should perform a background task.

I have set up the delegate and using SwiftUIs background task .appRefresh.
But for some reason it never triggers.
The scheduler is executed though, when the app is started.

import SwiftUI
import WatchKit

@main
struct WatchApp: App {
    
    @WKExtensionDelegateAdaptor(ExtensionDelegate.self) var delegate
    @ObservedObject var hostingModel = HostingModel.shared

    var body: some Scene {
        WindowGroup {
            ContentView()
                
        }
        .backgroundTask(.appRefresh) { context in
            print("background task")
            await hostingModel.fetchAll()
        }

    }
    
 
}


class ExtensionDelegate: NSObject, WKExtensionDelegate {
    @ObservedObject var hostingModel = HostingModel.shared

    func applicationDidFinishLaunching() {
        
    }

    func applicationDidBecomeActive() {
         hostingModel.scheduleBackgroundRefresh()
    }
    
    func applicationDidEnterBackground() {
        print("in background")
    }

// I believe it`s not needed this is just for debugging
    private func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) async {
        print("handle")
        await hostingModel.fetchAll()
    }
}

    func scheduleBackgroundRefresh() {
        WKApplication.shared()
            .scheduleBackgroundRefresh(
                withPreferredDate: Date.init(timeIntervalSinceNow: 15 * 60.0),
                userInfo: nil) { error in
                    if error != nil {
                        // Handle the scheduling error.
                        fatalError("*** An error occurred while scheduling the background refresh task. ***")
                    }

                    print("*** Scheduled! ***")
                }
    }

Am I missing something?

I followed this documentation, but no success.
Waited several hours overnight but a background refresh was never performed.
Any hints where what else I could debug?
Are any additional entries needs to be done in info.plist?

I also tried to change WKExtensionDelegate to WKApplicationDelegate , since this is on the Watch App target. But no difference

You better head Apple Developer Forums for Apple related SDKs, this forum is meant to be focused on Swift.

In terms of background tasks on Apple devices, they not guaranteed to execute at 100% and at specified time. I suggest read docs once again, it explicitly say this, for example:

For the system to allocate background execution time to your app, your app must have a complication on the active watch face. If the system gives your app background execution time, it attempts to trigger your background task no earlier than the time specified by the withPreferredDate parameter; however, depending on the watch’s state, the system can defer or throttle your tasks. Therefore, your app might not wake up exactly at the specified time.

When designing your app, don’t expect the system to trigger every background task. Design a fallback mechanism so your app behaves correctly even when throttling occurs. For example, even if your app never receives any background tasks, it can still update its state whenever the user launches it in the foreground.