Regex works in regex101, but not when I use it in js match

So, I’m trying to break a bunch of finnish names in to syllables to be used as data to make a name generator of sorts that makes, you guessed it, finnish inspired names out of syllables. However, for some reason, while trying to get my list of syllables, Javascript match aint working with me.

Idea is that that regex finds natural points of syllable lines in finnish (before consonant followed by a vowel and in vowel clusters which are not diftongs), but I noticed when playing with the data, that in purpose of my generator it would make a lot of sense to add exception, where doubles of the same consonant is broken off before the double consonant, not in the middle of it, as it just works better to the project. So names Mikki, Martti and Arska are usually broke in to syllables as Mik-ki, Ars-ka and Mart-ti, but I want the regex break Martti as mar-tti and Mikki and Mi-kki.

The regex monster I am usin in in display in here: https://regex101.com/r/rvXCrM/2 and it works fine in the regex101, but when I use it in my code like this:

const syllableRegex = /[bcdfghjklmnpqrstvwxz]*(?:a[aiu]?|e[eiuy]?|i[eiuy]?|o[iou]?|u[iou]?|y[iyö]?|ä[iyä]?|ö[iyö]?)(?:[bcdfghjklmnpqrstvwxz]*$|[bcdfghjklmnpqrstvwxz]?(?=(?:tt|kk|mm|nn|rr|ll|pp|ss)[aeiouyäö])|[bcdfghjklmnpqrstvwxz]+(?=[bcdfghjklmnpqrstvwxz][aeiouyäö]))?/gi;

function to_syllables(word) {
    return word.match(syllableRegex);
}

var names = [Mikki, Martti, Arska];

var syllable_charts = names.map(to_syllables);

console.log(syllable_charts);

The code does Arska and Martti right, but fails at Mikki. it specifically fails with any name, where it should cut the word between vowels and the double consonant. Can anyone tell me why and how to fix it?

If been trying different tokens and plaied around with rifferent or statements, but nothing seems to work. It is not elegant, and it is not working,what am I doing wrong?