JSON array of objects not being loaded in handsontable

Tags: #<Tag:0x00007efc71a7a110>

I am fetching data using ajax from database and trying to display it in handsontable I have checked in sole the data is being fetched from the database it is array of JSON objects but somehow Handsontable is not displaying it. Can you please help me in identifying what I am doing wrong here? I am adding my code and console screenshot that shows the data fetched from database. When I check the type of data it is Object. In console the fetched data is array of Objects.

    <script type="text/javascript">
      
        $(document).ready(function () {

            function getdata() {
                var result = null;

                $.ajax({
                    url: 'some url',
                    type: 'post',
                    dataType: 'json',
                    async: false,
                    success: function (res) {
                        result = res;
                        console.log(result);

                        console.log("typeof data should be array", typeof result);
                        return result;

                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        alert("Status: " + textStatus); alert("Error: " + errorThrown);

                    }
                    
                });
                return result;
            }

            const container = document.getElementById('example');
            var checkdata = getdata();
            console.log(checkdata);
            var hot = new Handsontable(container, {
                data: checkdata,
                rowHeaders: true,
                colHeaders: true,
                licenseKey: 'non-commercial-and-evaluation',
                colHeaders: true
            });

        });     
                      
    </script>

  ![Screenshot%20(80)|603x338](upload://2cmEWOp4ia1yzXYEHA72IW68nBo.png)

The topic is already on emails, but as we did not find a solution yet I will keep it opened.