SharePoint online Autocomplete javascript

Two SharePoint lists, List A and List B, are connected. List B uses a lookup value that references List A. This lookup functionality works well when there are less than 5,000 items in List A. However, it breaks once the number of items in List A exceeds this limit.

I’ve tried replacing the lookup with a custom Autocomplete JavaScript solution, but unfortunately, the autocomplete function also encounters the same issue and only works for lists with less than 5,000 entries. Here’s the script for reference. Could anyone offer assistance in resolving this problem as soon as possible?

Code:

<script src="/sites/xxxxx/SiteAssets/jquery.min.js"></script>
<script src="/sites/xxxxx/SiteAssets/jquery.SPServices-2014.02.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $().SPServices.SPAutocomplete({
            sourceList: "ABC",
            sourceColumn: "XYZ",
            columnName: "AtoZ",
            ignoreCase: true,
            numChars: 2,
            slideDownSpeed: 'fast'
        });
    });
</script>