wixUsers.register and .then giving "Cannot read property 'member' of null.

Hi there,
I would need some help to make code my code here bellow working…
Everything is working fine until the .then((result) of wixUser.register. CRM & DB are both correctly populated.
.catch brings this message from console : Cannot read property ‘member’ of null.
Everything which is within this .then is not working.

Sorry if this was already answered before. Actually there are a couple of similar topics on this website, but I still can’t find the solution.

Thanks !

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixData from 'wix-data';

$w.onReady(function () {
    $w('#submit').onClick(function () {
 let unformatedeEmail = $w('#email').value;
 let formatedEmail = unformatedeEmail.toLowerCase();
 let password = $w("#password").value;
        console.log(formatedEmail);

        wixData.query("customerDataBase")
            .eq("userEmail", formatedEmail)
            .limit(1)
            .find()
            .then((results) => {
 let emailPreviouslyRegistered = results.totalCount;
                console.log(emailPreviouslyRegistered);

 if (emailPreviouslyRegistered === 0) {

 //passing to Database
                    $w("#customerDataSet").new()
                        .then(() => {
                            $w('#customerDataSet').setFieldValue('firstName', $w('#firstName').value);
                            $w('#customerDataSet').setFieldValue('lastName', $w('#lastName').value);
                            $w('#customerDataSet').setFieldValue('streetNumber', $w('#streetNumber').value);
                            $w('#customerDataSet').setFieldValue('street', $w('#street').value);
                            $w('#customerDataSet').setFieldValue('postCode', $w('#zip').value);
                            $w('#customerDataSet').setFieldValue('city', $w('#city').value);
                            $w('#customerDataSet').setFieldValue('userEmail', (formatedEmail));
                            $w('#customerDataSet').setFieldValue('bic', $w('#bic').value);
                            $w('#customerDataSet').setFieldValue('iban', $w("#iban").value);
                            $w('#customerDataSet').save();
                            console.log("DataSet loaded");
                        })

 //passing to CRM
                    wixUsers.register(formatedEmail, password)
                        .then(() => {
                            console.log("OK");
                            wixLocation.to("/cart");
                        })
                        .catch((err) => {
                            console.log(err);
                        });

                } else {
                    $w("#mailChecker").text = "Ce compte existe déjà";
                    console.log("User already registered");

                }

            })
    })
});