Server script: "Cannot read properties of undefined (reading '0')"

I am getting the error above when trying to create a filter for a select field in a web form.

Custom script:

frappe.db.get_list('Beheer events',
    filters={
        'inschrijvingen_open': '1'
    },
    fields=['name', 'startdatum'],
    order_by='startdatum desc'
)
frappe.call({
        method: 'geopende_events',
        callback: function(r) {
        console.log(r)
        if (!r.exc) {
            number_list = r.message;
            var options = number_list[0];
            if (options) {
                number_list_value= Array.from(Object.keys(options), k => options[k]);
                number_list_value=number_list_value.filter(Boolean);
                frappe.web_form.set_df_property("event", "options",number_list_value)
            }
        }
    }
    })

Before, I used only the script below and that worked fine. The only issue was that guests received a whitelist error and therefore I had to find a new solution.

frappe.call({
        method: 'frappe.client.get_list',
        args: {
            doctype: 'Beheer events',
            filters: [
                ['inschrijvingen_open', '=', '1']
            ]
        },
        callback: function(r) {
        if (!r.exc) {
            number_list = r.message;
            var options = number_list[0];
            if (options) {
                number_list_value= Array.from(Object.keys(options), k => options[k]);
                number_list_value=number_list_value.filter(Boolean);
                frappe.web_form.set_df_property("event", "options",number_list_value)
            }
        }
    }