What could be causing the inconsistent behavior in notification processing when the Flutter app is in a killed state?

I'm developing a Flutter application that utilizes topic messaging to send notifications to iOS devices using Firebase Cloud Messaging (FCM). I've followed the FCM documentation to initialize the topic and set up an API for sending messages. The API is triggered every hour through a cron job on the server. When a topic message is received, the app displays a notification and performs some background processing. While the notification is successfully delivered when the app is in the background, I'm encountering inconsistent behavior when the app is in a killed state.

What I've Tried: I've double-checked the implementation of the FCM topic initialization and the message sending API, and everything appears to be correct. I've also verified that the cron job on the server is running as intended and the API calls are being made regularly. The issue seems to be related to how the app behaves when it's not running in the background.

Topic Initialisation:

if (!Platform.isAndroid) {
  await FirebaseMessaging.instance.subscribeToTopic("ios-scheduling");
}

API for delivering topic message:

  router.post('/', (req, res) => {
    const topic = "ios-scheduling";
    const body = req.body;
    console.log("Request Body", req.body);


    const message = {
        notification: {
            title: "OsuniO",
            body: "You may have some pending tasks.",
        },
        data: {
            "notificationType": body['notificationType']
        },
        apns: {
            payload: {
                aps: {
                    contentAvailable: true,
                    "interruption-level": "time-sensitive"
                }
            },
            headers: {
                "apns-push-type": "background",
                "apns-priority": "5",
                "apns-topic": "io.flutter.plugins.firebase.messaging"
            }
        },
        topic: topic
    };

    console.log("message to be sent to the user: ", message);

    admin.messaging().send(message)
        .then((response) => {
            // Response is a message ID string.
            console.log('Successfully sent message:', response);
            res.status(200).json(message);
        })
        .catch((error) => {
            console.log('Error sending message:', error);
            res.status(400).json({
                message: error
            }).end();
        });
     });
    module.exports = router;

Expected Behavior: I expect that when a topic message is sent via FCM, regardless of whether the Flutter application is in the foreground, background, or killed state, the notification should be reliably displayed on the device. Additionally, the associated API should be triggered consistently to perform the required background processing.