Why a JS method in Odoo 16 works only sometimes with similar environments?

I’m working with Odoo 16. I’ve installed the Enterprise Barcode app, and I’ve made a generic development over it.

The Barcode app has a menu which shows pickings in a kanban view. What I’m doing with my development is to automatically fill in a picking field each time an user belonging to a specific group clicks on its kanban card to open it.

Example: the barcode app shows three pickings (PICK001, PICK002, PICK003) in a kanban view. I’m the user Administrator and I click on the kanban card of PICK003 and this way I’m redirected to other view which shows the stock move lines of the PICK003. At the same time, my development sets the picking field preparer_id (a Many2one pointing to res.users) to Administrator.

Now, the code of my development:

/** @odoo-module **/
import { StockBarcodeKanbanController } from '@stock_barcode/kanban/stock_barcode_kanban_controller';
import { patch } from 'web.utils';
import { useService } from "@web/core/utils/hooks";
import { session } from "@web/session";

const originalOpenRecord = StockBarcodeKanbanController.prototype.openRecord;

patch(StockBarcodeKanbanController.prototype, 'StockBarcodeKanbanControllerIchExt', {
    setup() {
        this._super.apply(this, arguments);
        this.rpc = useService("rpc");
    },

    async openRecord(record) {
        // Check if preparer_id is empty
        if (!record.data.preparer_id) {
            // Check if current user is preparer (belong to preparers group)
            const isPreparer = await this.rpc("/web/dataset/call_kw", {
                model: 'res.users',
                method: 'has_group',
                args: ['ich_stock_ext.group_stock_preparer'],
                kwargs: {}
            });
            if(isPreparer) {
                // Call RPC to update preparer_id value with the current user
                await this.rpc('/web/dataset/call_kw/stock.picking/write', {
                    model: 'stock.picking',
                    method: 'write',
                    args: [[record.resId], { 'preparer_id': session.uid }],
                    kwargs: {}
                });
                // Refresh view
                this.model.load({reload: true});
            }
        }
        // Call "super" to execute whatever the original method did
        return originalOpenRecord.apply(this, arguments);
    },

});

This code seems to work perfect. However, sometimes, especially when I log in through the Odoo mobile app, if I click on PICK003, then on PICK002, and afterwards on PICK003 again, the field preparer_id remains empty, instead of showing the user again.

I’ve checked the field during every step. I have another development which empties the field when going back to the kanban view. This other development always works fine, so before clicking on a kanban card, the preparer_id is always empty.

What could be happening? How can I change the code to ensure that the preparer_id is updated in every situation?